I have recently discovered the power of GP-GPU (general purpose graphics processing unit) and want to take advantage of it to perform 'heavy' scientific and math calculations (that otherwise require big CPU clusters) on a single machine.
I know that there are several interfaces to operate on a GPU, the most prominent of those being CUDA and OpenCL. The latter has the advantage against CUDA to run on most graphics cards (NVIDIA, AMD, Intel) rather than NVIDA cards only. In my case, I have an ordinary Intel 4000 GPU that seems to be well cooperating with OpenCL.
Now, I need to learn how to operate with PyOpenCL to get it on further! So here comes the question:
How can I get started with PyOpenCL? What are the prerequisites? Do I really need to be experienced in Python and/or OpenCL?
My background is in fortran and as a matter of fact I need to translate and parallelize a lengthy fortran code to python (or pyopencl) that mainly deals with solving PDEs and diagonalizing matrices.
I have read the two relevant websites http://enja.org/2011/02/22/adventures-in-pyopencl-part-1-getting-started-with-python/ and http://documen.tician.de/pyopencl/ but they are not really helpful for newbies (ie, dummies).
I just don't know what to begin with. I do not aspire on becoming an expert on the field, just to get to know how one can parallelize simple math and linear algebra on pyopencl.
Any advice and help is highly welcome!
PyOpenCL lets you access GPUs and other massively parallel compute devices from Python. It tries to offer computing goodness in the spirit of its sister project PyCUDA: Object cleanup tied to lifetime of objects. This idiom, often called RAII in C++, makes it much easier to write correct, leak- and crash-free code.
CUDA is a proprietary API and set of language extensions that works only on NVIDIA's GPUs. OpenCL, by the Khronos Group, is an open standard for parallel programming using Central Processing Units (CPUs), GPUs, Digital Signal Processors (DSPs), and other types of processors.
It seems you are looking for the fastest and most effective path to learn PyOpenCL. You do not need to know OpenCL (the hard part) at the start, but it will be helpful to know Python when you begin.
For learning Python syntax quickly, I recommend Codecademy's Python track: http://www.codecademy.com/tracks/python
Then, the Udacity parallel programming course is a great place to start with GPGPU (even though the course is taught in CUDA). https://www.udacity.com/course/cs344 This course will teach you fundamental GPGPU concepts very quickly. You will not need a NVIDIA GPU to participate, because all the course assessments are done online.
After (or during) the Udacity course, I recommend you read, run, and customize PyOpenCL code examples: https://github.com/inducer/pyopencl/tree/master/examples
Irrespective of the language of adoption for GPGPU computing such as Java,C/C++, Python, I would recommend you first get started with the basics of GPGPU computing and OpenCL.
You can use the following resources all are C/C++ oriented but this should you give enough knowledge about OpenCL, GPGPU hardware to get you started.
AMD OpenCL University Tool kit
Hetergeneous Computing with OpenCL Book 2nd Edition
NVIDIA OpenCL pages is another Excellent resorce
Streamcomputing.eu has nice openCL starter articles.
Intel OpenCL SDK tutorial
PyOpenCL specific
Both the books contain OpenCL 1.1 implementation but it should be good starting point for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With