From 028d33e09426be27bf7e0358cc204f4b4644ba82 Mon Sep 17 00:00:00 2001 From: Matt Wala <wala1@illinois.edu> Date: Thu, 18 Jan 2018 18:47:18 -0600 Subject: [PATCH] Use vstore4 to do a vector copy. --- pyopencl/clrandom.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pyopencl/clrandom.py b/pyopencl/clrandom.py index ba0d61b3..decab716 100644 --- a/pyopencl/clrandom.py +++ b/pyopencl/clrandom.py @@ -287,10 +287,7 @@ class RanluxGenerator(object): while (idx + 4 < out_size) { output_vec_t ran = GET_RANDOM_NUM(RANLUX_FUNC(&ranluxclstate)); - output[idx] = ran.x; - output[idx + 1] = ran.y; - output[idx + 2] = ran.z; - output[idx + 3] = ran.w; + vstore4(ran, 0, &output[idx]); idx += 4*NUM_WORKITEMS; } @@ -598,10 +595,7 @@ class Random123GeneratorBase(object): while (idx + 4 < out_size) { output_vec_t ran = GET_RANDOM_NUM(gen_bits(&k, &c)); - output[idx] = ran.x; - output[idx + 1] = ran.y; - output[idx + 2] = ran.z; - output[idx + 3] = ran.w; + vstore4(ran, 0, &output[idx]); idx += 4*get_global_size(0); } -- GitLab