[PyOpenCL] CPU and GPU performs exactly the same as device?
patric.hol at gmail.com
Fri Jun 10 00:41:08 PDT 2011
I have an AMD processor (Phenom II X4 965 BE) and an ATI graphics card (ATI
Radeon HD 5850), I have uploaded properties to pastebin. When I set
each of them as devices separately in my code, they seem to run with pretty
much the exact same performance in all different kinds of python/pyopencl
programs. When I benchmarked one of my programs, I got these results:
The plot points are taken for evenly increased thread size by 32. Note that
the first maximum of GTX470 is 32*448, which is the warp size times the
amount of CUDA cores. The speedup is roughly 80 times versus the
unparallelized equivalent C-code (not so heavily optimized), when measuring
only execution time.
Can it really be that I have managed to get a CPU and GPU that performs
pretty much exactly the same in all programs? It looks like as if the CPU is
always chosen as device instead of the GPU, as the performance seems a bit
low for the graphics card. I use the same code as in benchmark_all.py to
fech and set my devices:
for platform in cl.get_platforms():
for device in platform.get_devices():
if cl.device_type.to_string(device.type) == "GPU":
gpu_dev = device
elif cl.device_type.to_string(device.type) == "CPU":
cpu_dev = device
Then I create the context with:
ctx = cl.create_some_context([cpu_dev])
ctx = cl.create_some_context([gpu_dev])
Any thoughts or ideas?
 benchmark_all.py output: http://pastebin.com/Fb2SypDx
 dump-properties.py output: http://pastebin.com/2trsxRZ7
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyOpenCL