Description

The following table describes the list of additional data types supported by OpenCL.

Table 1. Other Built-in Data Types

Type

Description

image2d_t [1]

A 2D image.

image3d_t [1]

A 3D image.

image2d_array_t [1]

A 2D image array.

Requires support for OpenCL C 1.2 or newer.

image1d_t [1]

A 1D image.

Requires support for OpenCL C 1.2 or newer.

image1d_buffer_t [1]

A 1D image created from a buffer object.

Requires support for OpenCL C 1.2 or newer.

image1d_array_t [1]

A 1D image array.

Requires support for OpenCL C 1.2 or newer.

image2d_depth_t [1]

A 2D depth image.

Requires support for OpenCL C 2.0 or newer, also see cl_khr_depth_images extension.

image2d_array_depth_t [1]

A 2D depth image array.

Requires support for OpenCL C 2.0 or newer, also see cl_khr_depth_images extension.

sampler_t [1]

A sampler type.

queue_t

A device command-queue. This queue can only be used to enqueue commands from kernels executing on the device.

Requires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the __opencl_c_device_enqueue feature.

ndrange_t

The N-dimensional range over which a kernel executes.

Requires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the __opencl_c_device_enqueue feature.

clk_event_t

A device-side event that identifies a command enqueued to a device command-queue.

Requires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the __opencl_c_device_enqueue feature.

reserve_id_t

A reservation ID. This opaque type is used to identify the reservation for reading and writing a pipe.

Requires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the __opencl_c_pipes feature.

event_t

An event. This can be used to identify async copies from global to local memory and vice-versa.

cl_mem_fence_flags

This is a bitfield and can be 0 or a combination of the following values ORed together:

CLK_GLOBAL_MEM_FENCE
CLK_LOCAL_MEM_FENCE
CLK_IMAGE_MEM_FENCE

These flags are described in detail in the synchronization functions section.

The image2d_t, image3d_t, image2d_array_t, image1d_t, image1d_buffer_t, image1d_array_t, image2d_depth_t, image2d_array_depth_t and sampler_t types are only defined if the device supports images, i.e. the value of the CL_DEVICE_IMAGE_SUPPORT device query) is CL_TRUE. If this is the case then an OpenCL C 3.0 or newer compiler must also define the __opencl_c_images feature macro.

The C99 derived types (arrays, structs, unions, functions, and pointers), constructed from the built-in scalar, vector, and other data types are supported, with specified restrictions.

The following tables describe the other built-in data types in OpenCL described in Other Built-in Data Types and the corresponding data type available to the application:

Type in OpenCL C

API type for application

image2d_t

cl_mem

image3d_t

cl_mem

image2d_array_t

cl_mem

image1d_t

cl_mem

image1d_buffer_t

cl_mem

image1d_array_t

cl_mem

image2d_depth_t

cl_mem

image2d_array_depth_t

cl_mem

sampler_t

cl_sampler

queue_t

cl_command_queue

ndrange_t

N/A

clk_event_t

N/A

reserve_id_t

N/A

event_t

N/A

cl_mem_fence_flags

N/A

See Also

Document Notes

For more information, see the OpenCL C Specification

This page is extracted from the OpenCL C Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2023 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0


1. Refer to the detailed description of the built-in Image Read and Write Functions that use this type.