diff --git a/pyopencl/clrandom.py b/pyopencl/clrandom.py
index ba0d61b32a727bb0e1406ad06015c0f763ad2a54..decab716aa5d5f192fb3e4820e47fd491f1f13ce 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);
                 }