[PyOpenCL] CPU and GPU performs exactly the same as device?

Patric Holmvall patric.hol at gmail.com
Fri Jun 10 00:41:08 PDT 2011


Hi,
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[1][2]. 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:
http://img832.imageshack.us/img832/9056/benchmarkresult.png
http://img833.imageshack.us/img833/5791/benchmarkresultzoom.png

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])
or:
    ctx = cl.create_some_context([gpu_dev])

Any thoughts or ideas?

Yours sincerely,
Patric Holmvall


[1] benchmark_all.py output: http://pastebin.com/Fb2SypDx
[2] dump-properties.py output: http://pastebin.com/2trsxRZ7
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tiker.net/pipermail/pyopencl/attachments/20110610/232b4e40/attachment.html>


More information about the PyOpenCL mailing list