Creating kernel objects

In this section we will discuss details about the kernel objects, and how kernel objects can be created using the program objects. Every program is a collection of kernels, you can consider a program object as a library of kernels. As shown in the following figure a program is associated with kernel1 and kernel2. The program is built with inputs as two devices device1 and device2. A kernel when enqueued on the command queue, the OpenCL runtime generates the binary for execution on the device. Note that each kernel can be executed on different devices. It is at the runtime the binaries are generated.

A kernel object can be created from a well formed OpenCL C program, which is built as discussed in the previous section. A ...

Get OpenCL Programming by Example 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.