Hi Patric,

On Sat, 5 Mar 2011 12:34:14 +0100, Patric Holmvall <[email protected]> wrote:
> Dear mailing list recipients,
> Whenever I run clrandom.rand, it takes approximately 9 seconds
> independent of the amount of random numbers. This is quite frustrating
> since I have a program where I need to run clrandom.rand several
> times. I'm getting the problem on my AMD/ATI platform. I don't get the
> problem on my Nvidia platform. Anyone got suggestions? Am I doing
> something wrong?
> 
> #### Example output: ####
> Creating 10 randoms with opencl in 9.00800013542s
> Creating 10 randoms with numpy in 0.0s
> 
> Creating 100000000 randoms with opencl in 8.90499997139s
> Creating 100000000 randoms with numpy in 2.40300011635s
> 
> #### Example Code: ####
> import pyopencl as cl
> import pyopencl.clrandom
> import numpy
> import time
> 
> numpy.random.seed()
> N = 10**8 # Amount of random numbers
> 
> ctx = cl.create_some_context()
> queue = cl.CommandQueue(ctx)
> dtype = numpy.float32
> 
> tic = time.time()
> clrandoms = cl.clrandom.rand(ctx, queue, N, dtype)
> print "Creating " + str(N) + " randoms with opencl in " +
> str(time.time() - tic) + "s"
> 
> tic = time.time()
> nprandoms = numpy.random.rand(N).astype(dtype)
> print "Creating " + str(N) + " randoms with numpy in " +
> str(time.time() - tic) + "s"

Yup, known issue. MD5 (which is what the code currently uses) kind of
stinks as an RNG. If you have time to do this, I'd be happy to take a
patch.

Andreas

Attachment: pgpCbv6q3FT8L.pgp
Description: PGP signature

_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to