OpenCL

Kelp.Net makes heavy usage of the open computing language, or OpenCL. According to Wikipedia:

"OpenCL views a computing system as consisting of a number of compute devices, which might be central processing units (CPUs), or accelerators such as graphics processing units (GPUs), attached to a host processor (a CPU). Functions executed on an OpenCL device are called kernels. A single compute device typically consists of several compute units, which in turn comprise multiple processing elements (PS). A single kernel execution can run on all or many of the PEs in parallel."

In OpenCL, tasks are scheduled on command queues. There is at least one command queue for each device. The OpenCL runtime breaks the scheduled data-parallel tasks into pieces and sends the tasks to the device processing element.

OpenCL defines a memory hierarchy:

  • Global: Shared by all processing elements, and has high latency
  • Read-only: Smaller, of lower latency, and writable by the host CPU but not compute devices
  • Local: Shared by a process element group
  • Per-element: Private memory

OpenCL also provides an API designed more towards math. This can be seen in the exposure of fixed-length vector types such as float4 (four vector of single-precision floats), available in lengths of 2, 3, 4, 8 and 16. As you gain more exposure to Kelp.Net and start to create your own functions, you will encounter OpenCL programming. For now, it's enough to know that it exists and is being used under the hood extensively.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.222.185