Image access qualifiers

OpenCL specification provides two types of access qualifiers for different types of image memory objects. They can be either read_only or write_only. In the following example imageA is read-only image object, and imageB is a write-only image object:

__kernel void foo (read_only image2d_t imageA,
                   write_only image2d_t imageB)

About function qualifiers and attributes, __kernel qualifier declares a function which is defined explicitly to run on an OpenCL device. A __kernel qualified function can be invoked inside another kernel function. In such a situation the kernel function just behaves as another function call. There are optional function attributes which can be specified for kernel functions.

The __kernel qualified functions ...

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.