Hello,
I am just looking at opencl for the first time today. Looks pretty neat. I added the following lines to benchmark-all.py:

c_result2 = numpy.empty_like(a)
time1 = time()
c_result2 = a + b
c_result2 = c_result2 * (a + b)
c_result2 = c_result2 * (a / 2.0)
time2 = time()
print "Execution time of test without OpenCL, but with numpy: ", time2 - time1, "s"

To do the same calculations the way numpy was designed to do, and got the following results (edited for readability):

Execution time of test without OpenCL:  23.8333249092 s
Execution time of test without OpenCL, but with numpy: 7.41481781006e-05 s
Execution time of test: 0.014881 s

The numpy way is quite a bit faster. My question is, is there a use case where the use of opencl would overtake numpy for these types of calculations? Or maybe I just have a sucky GPU? I don't know.

Craig


_______________________________________________
PyOpenCL mailing list
[email protected]
http://tiker.net/mailman/listinfo/pyopencl_tiker.net

Reply via email to