[PyOpenCL] Learning OpenCL through PyOpenCL
Keith Brafford
keith.brafford at gmail.com
Sat Feb 19 19:52:17 PST 2011
Patric Holmvall <patric.hol at ...> writes:
>...I'm new to both OpenCL and Python ... PyOpenCL is a shortcut that blocks me
>from directly applying 99% of all the material/tutorials online, since they
>follow implementation of OpenCL in a C environment.
When I started learning OpenCL I was also new to PyOpenCL, but experienced with
Python itself. As an experienced Python programmer (and having used Numpy a lot
in other projects) it was extremely easy for me to adapt the C examples to
PyOpenCL using the examples as a guide.
But I can see how someone who is new to both of them at the same time would
think that it's a blocker. If I were you I'd start my kernels in C so that you
can deal with programming errors and learning curve stuff without suspecting
your programming environment.
Once you get tired of waiting on recompiles and you understand what you are
doing with these 5 basic things:
1) Input buffers copied from the host
2) Kernel compilation
3) Kernel Argument setup
4) Kernel execution
5) Fetching result buffers back to the host
then I'd learn how to do all that from Python. Once you know enough OpenCL so
that it doesn't look foreign, you will realize that PyOpenCL is not blocking you
at all. It actually makes it more pleasant.
Just my two cents...
--Keith Brafford
More information about the PyOpenCL
mailing list