Address space qualifiers

There are four different address space qualifiers supported by OpenCL. The address space qualifier is used in variable declarations to specify the region of memory to allocate the declared object. The following is the list of address qualifiers:

  • __global or global
  • __local or local
  • __constant or constant
  • __private or private

A data type object in a kernel program is allocated space in the specified address space qualifier. If no specifier is given then a generic address space is considered. For example all kernel function arguments and local variables will take a __private if no address space qualifier is specified. Image memory objects arguments of type image2d_t, image3d_t, image2d_array_t, image1d_t, image1d_buffer_t, and ...

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.