OpenCL is a framework for writing programs that execute across heterogeneous platforms consisting of CPUs, GPUs, and other processors. OpenCL includes a language (based on C99) for writing kernels (functions that execute on OpenCL devices), plus APIs that are used to define and then control the platforms. OpenCL provides parallel computing using task-based and data-based parallelism.

One of the unique characteristics of OpenCL is that it allows for code to target different processing unit types (CPUs or GPUs) dynamically, depending on the host configuration.

OpenCL consists of modest extensions to the C language, which includes support for vector types, managed data buffers, mathematical consistency guarantees across computing devices and a limited number of new keywords.

An OpenCL compute platform consists of several compute devices, where a compute device is either a CPU or a GPU. A compute device has one or more compute units (e.g. a dual core CPU has 2 compute units). An OpenCL application submits work to compute devices, wrapped in work items called kernels (C functions that perform a certain computation). Unlike traditional C code, OpenCL kernels are incorporated into the application in an uncompiled state. They are compiled on the fly and optimized for the user’s hardware before being sent to the GPU for processing. Each compute device maintains a queue of kernels, which can be executed in order or out of order based on the invocation of external signals. A kernel reads data from a private memory area setup before its invocation, performs the computation and copies data back to a special result area.

The OpenCL runtime is responsible for a number of tasks such as setting up memory buffers, scheduling work on the available compute units and (optionally) compiling the kernels to better match the underlying architecture.


No major application, except from impressive demos, has been found that uses OpenCL. Also, no uses on supercomputers have been discovered, although support for running clusters of OpenCL compute nodes can been enabled through the Mosix Virtual OpenCL project. Other creative uses of OpenCL include GPU assisted password cracking and malware applications. [1]

OpenCL has been developed by Apple and was standardised by the Khronos group. Since then it has received wide industry adoption, mainly in the graphics processing community. All major graphics vendors offer OpenCL enabled drivers. Apple MacOSX includes OpenCL for CPUs and GPUs since version 10.6. IBM provides an OpenCL implementation for Cell BE processors running in Bladecenters. Intel will support OpenCL in future CPU architectures + compilers.

License: Open Standard, License depends on implementation

[1] Giorgos Vasiliadis, Michalis Polychronakis, Sotiris Ioannidis. GPU-Assisted Malware. 2010