Oops, It looks like, upon further review, that those opencl results below are just for my cpu. I don't have gpu results and probably don't have a gpu. I'm going to try on another computer and I'll update this post.

Craig



On Sep 17, 2009, at 12:59 PM, Craig Swank wrote:

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


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

Reply via email to