Tutorial by Examples

OpenCL Kernels can be either executed on the GPU or the CPU. This allows for fallback solutions, where the customer may have a very outdated system. The programmer can also choose to limit their functionality to either the CPU or GPU. To get started using OpenCL, you'll need a 'Context' and a 'Devi...
Kernels can be compiled at runtime on the target device. To do so, you need the kernel source code the target device on which to compile a context built with the target device A quick terminology update: A program contains a collection of kernels. You can think of a program as a complete C/C...
To initiate any operation on your devices, you'll need a command queue for each device. The Queue keeps track of different calls you did to the target device and keeps them in order. Most commands can also be executed either in blocking or non-blocking mode. Creating a queue is pretty straightforwa...
So now we come down to the real stuff, executing your kernels on the parallel device. Please read about the hardware basics to fully understand the kernel dispatching. First you'll need to set the kernel arguments before actually calling the kernel. This is done via err = Cl.SetKernelArg(_kernel, ...

Page 1 of 1