tags:

views:

88

answers:

2

i want to start gpgpu programming in python. should i start with pyopencl or clyther? whats the difference?

+1  A: 

It seems to me that PyOpenCL is closer to the C bindings for OpenCL than CLyther.

This means that if you already know OpenCL, or plan to port implementations from other languages to Python, then PyOpenCL might be for you. On the other hand, CLyther seems more "pythonic" than PyOpenCL, so if you are more familiar with Python, then the idioms used might be easier for you to understand.

Both of them are in Beta, so you might not have all of the features you might want in either, and there might be bugs in either.

Good luck!

KLee1
A: 

CLyther contains bindings at the C level similar to OpenCL and PyOpenCL.

clyther is 'pythonic' in the fact that is also allows you to pass and or use python functions as openCL device/kernel functions.

Inline in your python code you can write

@kernel
@bind('global_work_size' ,'a.size')
@bind('local_work_size' , 1)
def sum(a,b,ret):
    i = clrt.get_global_id(0)
    ret[i] = a[i] + b[i]

sum(clarray1,clarray2,clarray3)
sean