Built-in functions

In OpenCL C you cannot include the standard header files provided by C99 standard such as, math.h, stdio.h, stdlib.h, errno.h, and so on. OpenCL C provides a huge set of built in functions, which can be used by the programmer for programming the OpenCL kernels. Using built-in functions wherever possible may result in performance enhancement. Also this will make sure the code is portable across different vendors. We will discuss briefly the group of built-ins and will leave it to the reader to take a look at section 6.12 of OpenCL specification 1.2.

Work item function

While enqueuing a kernel using clEnqueueNDRangeKernel, we specify the global and local work sizes. To determine these values during the kernel function execution ...

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.