OpenCL execution model
The OpenCL execution model includes the host application, the context, and the operation of OpenCL kernels.
- The host application
The host application runs on the application processor. The host application manages the execution of the kernels by setting up command queues for:
- Memory commands.
- Kernel execution commands.
- The context
The host application defines the context for the kernels. The context includes:
- The kernels.
- Compute devices.
- Program objects.
- Memory objects.
- Operation of OpenCL kernels
Kernels run on compute devices. A kernel is a block of code that is executed on a compute device in parallel with other kernels. Kernels operate in the following sequence:
- The kernel is defined in a host application.
The host application submits the kernel for execution on a compute device. A compute device can be an application processor, GPU, or another type of processor.
- When the application issues a command to submit a kernel, OpenCL creates the NDRange of work-items.
- An instance of the kernel is created for each element in the NDRange. This enables each element to be processed independently in parallel.