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"


Yours sincerely,
Patric

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

Reply via email to