Writing massively parallel code for heterogeneous platforms with OpenCL

In the previous recipe, we introduced CUDA, a proprietary GPGPU framework created by NVIDIA Corporation. In this recipe, we present OpenCL, an alternative open framework initiated by Apple in 2008. It is now adopted by mainstream companies including Intel, NVIDIA, AMD, Qualcomm, ARM, and others. These companies are regrouped within the non-profit technology consortium Khronos Group (which also maintains the OpenGL real-time rendering specification). Programs written in OpenCL can run on GPUs and CPUs (heterogeneous computing).

Tip

CUDA and OpenCL are relatively similar in terms of concepts, syntax, and features. CUDA sometimes leads to slightly higher performance, since its ...

Get IPython Interactive Computing and Visualization Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.