Excuse me stupid question, but why are you reimplementing
XORWOWRandomNumberGenerator instead of using it?

The code should look like this:

import numpy

# This initializes random number generator
r = pycuda.curandom.XORWOWRandomNumberGenerator()
# This will create GPUArray of 32-bit floats with
# sizes 100x200x300 and fill it with normalized random
# numbers
array = r.gen_normal((100, 200, 300), dtype = numpy.float32)
# Or, if you already have array...
array = pycuda.gpuarray.GPUArray((200, 400), dtype = numpy.float32)
r.fill_normal(array)

It will use as many cores as you have, check for errors, etc.

Best regards



-- 
Tomasz Rybak <[email protected]> GPG/PGP key ID: 2AD5 9860
Fingerprint A481 824E 7DD3 9C0E C40A  488E C654 FB33 2AD5 9860
http://member.acm.org/~tomaszrybak

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to