C Specification

To get specific information about an OpenCL device, call the function:

cl_int clGetDeviceInfo(
    cl_device_id device,
    cl_device_info param_name,
    size_t param_value_size,
    void* param_value,
    size_t* param_value_size_ret);

Parameters

  • device may be a device returned by clGetDeviceIDs or a sub-device created by clCreateSubDevices. If device is a sub-device, the specific information for the sub-device will be returned. The information that can be queried using clGetDeviceInfo is specified in the Device Queries table.

  • param_name is an enumeration constant that identifies the device information being queried. It can be one of the following values as specified in the Device Queries table.

  • param_value is a pointer to memory location where appropriate values for a given param_name, as specified in the Device Queries table, will be returned. If param_value is NULL, it is ignored.

  • param_value_size specifies the size in bytes of memory pointed to by param_value. This size in bytes must be ≥ size of return type specified in the Device Queries table.

  • param_value_size_ret returns the actual size in bytes of data being queried by param_name. If param_value_size_ret is NULL, it is ignored.

Description

The device queries described in the Device Queries table should return the same information for a root-level device i.e. a device returned by clGetDeviceIDs and any sub-devices created from this device except for the following queries:

  • CL_​DEVICE_​GLOBAL_​MEM_​CACHE_​SIZE

  • CL_​DEVICE_​BUILT_​IN_​KERNELS

  • CL_​DEVICE_​PARENT_​DEVICE

  • CL_​DEVICE_​PARTITION_​TYPE

  • CL_​DEVICE_​REFERENCE_​COUNT

Table 1. List of supported param_names by https://www.khronos.org/registry/OpenCL/specs/2.2/html/OpenCL_API.html#clGetDeviceInfo
cl_device_info Return Type Description

CL_​DEVICE_​TYPE

cl_device_type

The OpenCL device type. Currently supported values are:

CL_​DEVICE_​TYPE_​CPU, CL_​DEVICE_​TYPE_​GPU, CL_​DEVICE_​TYPE_​ACCELERATOR, CL_​DEVICE_​TYPE_​DEFAULT, a combination of the above types, or CL_​DEVICE_​TYPE_​CUSTOM.

CL_​DEVICE_​VENDOR_​ID4

cl_uint

A unique device vendor identifier. An example of a unique device identifier could be the PCIe ID.

CL_​DEVICE_​MAX_​COMPUTE_​UNITS

cl_uint

The number of parallel compute units on the OpenCL device. A work-group executes on a single compute unit. The minimum value is 1.

CL_​DEVICE_​MAX_​WORK_​ITEM_​DIMENSIONS

cl_uint

Maximum dimensions that specify the global and local work-item IDs used by the data parallel execution model. (Refer to clEnqueueNDRangeKernel). The minimum value is 3 for devices that are not of type CL_​DEVICE_​TYPE_​CUSTOM.

CL_​DEVICE_​MAX_​WORK_​ITEM_​SIZES

size_t []

Maximum number of work-items that can be specified in each dimension of the work-group to clEnqueueNDRangeKernel.

Returns n size_t entries, where n is the value returned by the query for CL_​DEVICE_​MAX_​WORK_​ITEM_​DIMENSIONS.

The minimum value is (1, 1, 1) for devices that are not of type CL_​DEVICE_​TYPE_​CUSTOM.

CL_​DEVICE_​MAX_​WORK_​GROUP_​SIZE

size_t

Maximum number of work-items in a work-group that a device is capable of executing on a single compute unit, for any given kernel-instance running on the device. (Refer also to clEnqueueNDRangeKernel and CL_​KERNEL_​WORK_​GROUP_​SIZE ). The minimum value is 1. The returned value is an upper limit and will not necessarily maximize performance. This maximum may be larger than supported by a specific kernel (refer to the CL_​KERNEL_​WORK_​GROUP_​SIZE query of clGetKernelWorkGroupInfo).

CL_​DEVICE_​PREFERRED_​VECTOR_​WIDTH_​CHAR
CL_​DEVICE_​PREFERRED_​VECTOR_​WIDTH_​SHORT
CL_​DEVICE_​PREFERRED_​VECTOR_​WIDTH_​INT
CL_​DEVICE_​PREFERRED_​VECTOR_​WIDTH_​LONG
CL_​DEVICE_​PREFERRED_​VECTOR_​WIDTH_​FLOAT
CL_​DEVICE_​PREFERRED_​VECTOR_​WIDTH_​DOUBLE
CL_​DEVICE_​PREFERRED_​VECTOR_​WIDTH_​HALF

CL_​DEVICE_​PREFERRED_​VECTOR_​WIDTH_​HALF is missing before version 1.1.

cl_uint

Preferred native vector width size for built-in scalar types that can be put into vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.

If double precision is not supported, CL_​DEVICE_​PREFERRED_​VECTOR_​WIDTH_​DOUBLE must return 0.

If the cl_khr_fp16 extension is not supported, CL_​DEVICE_​PREFERRED_​VECTOR_​WIDTH_​HALF must return 0.

CL_​DEVICE_​NATIVE_​VECTOR_​WIDTH_​CHAR
CL_​DEVICE_​NATIVE_​VECTOR_​WIDTH_​SHORT
CL_​DEVICE_​NATIVE_​VECTOR_​WIDTH_​INT
CL_​DEVICE_​NATIVE_​VECTOR_​WIDTH_​LONG
CL_​DEVICE_​NATIVE_​VECTOR_​WIDTH_​FLOAT
CL_​DEVICE_​NATIVE_​VECTOR_​WIDTH_​DOUBLE
CL_​DEVICE_​NATIVE_​VECTOR_​WIDTH_​HALF

Missing before version 1.1.

cl_uint

Returns the native ISA vector width. The vector width is defined as the number of scalar elements that can be stored in the vector.

If double precision is not supported, CL_​DEVICE_​NATIVE_​VECTOR_​WIDTH_​DOUBLE must return 0.

If the cl_khr_fp16 extension is not supported, CL_​DEVICE_​NATIVE_​VECTOR_​WIDTH_​HALF must return 0.

CL_​DEVICE_​MAX_​CLOCK_​FREQUENCY

cl_uint

Clock frequency of the device in MHz. The meaning of this value is implementation-defined. For devices with multiple clock domains, the clock frequency for any of the clock domains may be returned. For devices that dynamically change frequency for power or thermal reasons, the returned clock frequency may be any valid frequency. Note: This definition is missing before version 2.2.

Maximum configured clock frequency of the device in MHz. Note: This definition is deprecated by version 2.2.

CL_​DEVICE_​ADDRESS_​BITS

cl_uint

The default compute device address space size of the global address space specified as an unsigned integer value in bits. Currently supported values are 32 or 64 bits.

CL_​DEVICE_​MAX_​MEM_​ALLOC_​SIZE

cl_ulong

Max size of memory object allocation in bytes. The minimum value is max(min(1024 × 1024 × 1024, 1/4th of CL_​DEVICE_​GLOBAL_​MEM_​SIZE), 32 × 1024 × 1024) for devices that are not of type CL_​DEVICE_​TYPE_​CUSTOM.

CL_​DEVICE_​IMAGE_​SUPPORT

cl_bool

Is CL_​TRUE if images are supported by the OpenCL device and CL_​FALSE otherwise.

CL_​DEVICE_​MAX_​READ_​IMAGE_​ARGS5

cl_uint

Max number of image objects arguments of a kernel declared with the read_only qualifier. The minimum value is 128 if CL_​DEVICE_​IMAGE_​SUPPORT is CL_​TRUE, the value is 0 otherwise.

CL_​DEVICE_​MAX_​WRITE_​IMAGE_​ARGS

cl_uint

Max number of image objects arguments of a kernel declared with the write_only qualifier. The minimum value is 64 if CL_​DEVICE_​IMAGE_​SUPPORT is CL_​TRUE, the value is 0 otherwise.

CL_​DEVICE_​MAX_​READ_​WRITE_​IMAGE_​ARGS6

Missing before version 2.0.

cl_uint

Max number of image objects arguments of a kernel declared with the write_only or read_write qualifier. The minimum value is 64 if CL_​DEVICE_​IMAGE_​SUPPORT is CL_​TRUE, the value is 0 otherwise.

CL_​DEVICE_​IL_​VERSION

Missing before version 2.1. Also see extension cl_khr_il_program.

char[]

The intermediate languages that can be supported by clCreateProgramWithIL for this device. Returns a space-separated list of IL version strings of the form <IL_Prefix>_<Major_Version>.<Minor_Version>. For OpenCL 2.1 and 2.2, SPIR-V is a required IL prefix.

CL_​DEVICE_​IMAGE2D_​MAX_​WIDTH

size_t

Max width of 2D image or 1D image not created from a buffer object in pixels.

The minimum value is 16384 if CL_​DEVICE_​IMAGE_​SUPPORT is CL_​TRUE, the value is 0 otherwise.

CL_​DEVICE_​IMAGE2D_​MAX_​HEIGHT

size_t

Max height of 2D image in pixels.

The minimum value is 16384 if CL_​DEVICE_​IMAGE_​SUPPORT is CL_​TRUE, the value is 0 otherwise.

CL_​DEVICE_​IMAGE3D_​MAX_​WIDTH

size_t

Max width of 3D image in pixels.

The minimum value is 2048 if CL_​DEVICE_​IMAGE_​SUPPORT is CL_​TRUE, the value is 0 otherwise.

CL_​DEVICE_​IMAGE3D_​MAX_​HEIGHT

size_t

Max height of 3D image in pixels.

The minimum value is 2048 if CL_​DEVICE_​IMAGE_​SUPPORT is CL_​TRUE, the value is 0 otherwise.

CL_​DEVICE_​IMAGE3D_​MAX_​DEPTH

size_t

Max depth of 3D image in pixels.

The minimum value is 2048 if CL_​DEVICE_​IMAGE_​SUPPORT is CL_​TRUE, the value is 0 otherwise.

CL_​DEVICE_​IMAGE_​MAX_​BUFFER_​SIZE

Missing before version 1.2.

size_t

Max number of pixels for a 1D image created from a buffer object.

The minimum value is 65536 if CL_​DEVICE_​IMAGE_​SUPPORT is CL_​TRUE, the value is 0 otherwise.

CL_​DEVICE_​IMAGE_​MAX_​ARRAY_​SIZE

Missing before version 1.2.

size_t

Max number of images in a 1D or 2D image array.

The minimum value is 2048 if CL_​DEVICE_​IMAGE_​SUPPORT is CL_​TRUE, the value is 0 otherwise.

CL_​DEVICE_​MAX_​SAMPLERS

cl_uint

Maximum number of samplers that can be used in a kernel.

The minimum value is 16 if CL_​DEVICE_​IMAGE_​SUPPORT is CL_​TRUE, the value is 0 otherwise.

CL_​DEVICE_​IMAGE_​PITCH_​ALIGNMENT

Missing before version 2.0.

cl_uint

The row pitch alignment size in pixels for 2D images created from a buffer. The value returned must be a power of 2.

If the device does not support images, this value must be 0.

CL_​DEVICE_​IMAGE_​BASE_​ADDRESS_​ALIGNMENT

Missing before version 2.0.

cl_uint

This query should be used when a 2D image is created from a buffer which was created using CL_​MEM_​USE_​HOST_​PTR. The value returned must be a power of 2.

This query specifies the minimum alignment in pixels of the host_ptr specified to clCreateBuffer.

If the device does not support images, this value must be 0.

CL_​DEVICE_​MAX_​PIPE_​ARGS

Missing before version 2.0.

cl_uint

The maximum number of pipe objects that can be passed as arguments to a kernel. The minimum value is 16.

CL_​DEVICE_​PIPE_​MAX_​ACTIVE_​RESERVATIONS

Missing before version 2.0.

cl_uint

The maximum number of reservations that can be active for a pipe per work-item in a kernel. A work-group reservation is counted as one reservation per work-item. The minimum value is 1.

CL_​DEVICE_​PIPE_​MAX_​PACKET_​SIZE

Missing before version 2.0.

cl_uint

The maximum size of pipe packet in bytes. The minimum value is 1024 bytes.

CL_​DEVICE_​MAX_​PARAMETER_​SIZE

size_t

Max size in bytes of all arguments that can be passed to a kernel.

The minimum value is 1024 for devices that are not of type CL_​DEVICE_​TYPE_​CUSTOM. For this minimum value, only a maximum of 128 arguments can be passed to a kernel

CL_​DEVICE_​MEM_​BASE_​ADDR_​ALIGN

cl_uint

Alignment requirement (in bits) for sub-buffer offsets. The minimum value is the size (in bits) of the largest OpenCL built-in data type supported by the device (long16 in FULL profile, long16 or int16 in EMBEDDED profile) for devices that are not of type CL_​DEVICE_​TYPE_​CUSTOM.

CL_​DEVICE_​MIN_​DATA_​TYPE_​ALIGN_​SIZE

Deprecated by version 1.2.

cl_uint

The minimum value is the size (in bytes) of the largest OpenCL data type supported by the device (long16 in FULL profile, long16 or int16 in EMBEDDED profile).

CL_​DEVICE_​SINGLE_​FP_​CONFIG7

cl_device_fp_config

Describes single precision floating-point capability of the device. This is a bit-field that describes one or more of the following values:

CL_​FP_​DENORM - denorms are supported

CL_​FP_​INF_​NAN - INF and quiet NaNs are supported.

CL_​FP_​ROUND_​TO_​NEAREST-- round to nearest even rounding mode supported

CL_​FP_​ROUND_​TO_​ZERO - round to zero rounding mode supported

CL_​FP_​ROUND_​TO_​INF - round to positive and negative infinity rounding modes supported

CL_​FP_​FMA - IEEE754-2008 fused multiply-add is supported.

CL_​FP_​CORRECTLY_​ROUNDED_​DIVIDE_​SQRT - divide and sqrt are correctly rounded as defined by the IEEE754 specification.

CL_​FP_​SOFT_​FLOAT - Basic floating-point operations (such as addition, subtraction, multiplication) are implemented in software.

For the full profile, the mandated minimum floating-point capability for devices that are not of type CL_​DEVICE_​TYPE_​CUSTOM is: CL_​FP_​ROUND_​TO_​NEAREST | CL_​FP_​INF_​NAN.

For the embedded profile, see the dedicated table.

CL_​DEVICE_​DOUBLE_​FP_​CONFIG8

Missing before version 1.2. Also see extension cl_khr_fp64.

cl_device_fp_config

Describes double precision floating-point capability of the OpenCL device. This is a bit-field that describes one or more of the following values:

CL_​FP_​DENORM - denorms are supported

CL_​FP_​INF_​NAN - INF and NaNs are supported.

CL_​FP_​ROUND_​TO_​NEAREST - round to nearest even rounding mode supported.

CL_​FP_​ROUND_​TO_​ZERO - round to zero rounding mode supported.

CL_​FP_​ROUND_​TO_​INF - round to positive and negative infinity rounding modes supported.

CL_​FP_​FMA - IEEE754-2008 fused multiply-add is supported.

CL_​FP_​SOFT_​FLOAT - Basic floating-point operations (such as addition, subtraction, multiplication) are implemented in software.

Double precision is an optional feature so the mandated minimum double precision floating-point capability is 0.

If double precision is supported by the device, then the minimum double precision floating-point capability must be:
CL_​FP_​FMA |
CL_​FP_​ROUND_​TO_​NEAREST |
CL_​FP_​INF_​NAN |
CL_​FP_​DENORM.

CL_​DEVICE_​GLOBAL_​MEM_​CACHE_​TYPE

cl_device_mem_cache_type

Type of global memory cache supported. Valid values are: CL_​NONE, CL_​READ_​ONLY_​CACHE, and CL_​READ_​WRITE_​CACHE.

CL_​DEVICE_​GLOBAL_​MEM_​CACHELINE_​SIZE

cl_uint

Size of global memory cache line in bytes.

CL_​DEVICE_​GLOBAL_​MEM_​CACHE_​SIZE

cl_ulong

Size of global memory cache in bytes.

CL_​DEVICE_​GLOBAL_​MEM_​SIZE

cl_ulong

Size of global device memory in bytes.

CL_​DEVICE_​MAX_​CONSTANT_​BUFFER_​SIZE

cl_ulong

Max size in bytes of a constant buffer allocation. The minimum value is 64 KB for devices that are not of type CL_​DEVICE_​TYPE_​CUSTOM.

CL_​DEVICE_​MAX_​CONSTANT_​ARGS

cl_uint

Max number of arguments declared with the __constant qualifier in a kernel. The minimum value is 8 for devices that are not of type CL_​DEVICE_​TYPE_​CUSTOM.

CL_​DEVICE_​MAX_​GLOBAL_​VARIABLE_​SIZE

Missing before version 2.0.

size_t

The maximum number of bytes of storage that may be allocated for any single variable in program scope or inside a function in an OpenCL kernel language declared in the global address space.

The minimum value is 64 KB.

CL_​DEVICE_​GLOBAL_​VARIABLE_​PREFERRED_​TOTAL_​SIZE

Missing before version 2.0.

size_t

Maximum preferred total size, in bytes, of all program variables in the global address space. This is a performance hint. An implementation may place such variables in storage with optimized device access. This query returns the capacity of such storage. The minimum value is 0.

CL_​DEVICE_​LOCAL_​MEM_​TYPE

cl_device_local_mem_type

Type of local memory supported. This can be set to CL_​LOCAL implying dedicated local memory storage such as SRAM , or CL_​GLOBAL.

For custom devices, CL_​NONE can also be returned indicating no local memory support.

CL_​DEVICE_​LOCAL_​MEM_​SIZE

cl_ulong

Size of local memory region in bytes. The minimum value is 32 KB for devices that are not of type CL_​DEVICE_​TYPE_​CUSTOM.

CL_​DEVICE_​ERROR_​CORRECTION_​SUPPORT

cl_bool

Is CL_​TRUE if the device implements error correction for all accesses to compute device memory (global and constant). Is CL_​FALSE if the device does not implement such error correction.

CL_​DEVICE_​HOST_​UNIFIED_​MEMORY

Missing before version 1.1 and deprecated by version 2.0.

cl_bool

Is CL_​TRUE if the device and the host have a unified memory subsystem and is CL_​FALSE otherwise.

CL_​DEVICE_​PROFILING_​TIMER_​RESOLUTION

size_t

Describes the resolution of device timer. This is measured in nanoseconds. Refer to Profiling Operations for details.

CL_​DEVICE_​ENDIAN_​LITTLE

cl_bool

Is CL_​TRUE if the OpenCL device is a little endian device and CL_​FALSE otherwise

CL_​DEVICE_​AVAILABLE

cl_bool

Is CL_​TRUE if the device is available and CL_​FALSE otherwise. A device is considered to be available if the device can be expected to successfully execute commands enqueued to the device.

CL_​DEVICE_​COMPILER_​AVAILABLE

cl_bool

Is CL_​FALSE if the implementation does not have a compiler available to compile the program source.

Is CL_​TRUE if the compiler is available. This can be CL_​FALSE for the embedded platform profile only.

CL_​DEVICE_​LINKER_​AVAILABLE

Missing before version 1.2.

cl_bool

Is CL_​FALSE if the implementation does not have a linker available. Is CL_​TRUE if the linker is available.

This can be CL_​FALSE for the embedded platform profile only.

This must be CL_​TRUE if CL_​DEVICE_​COMPILER_​AVAILABLE is CL_​TRUE.

CL_​DEVICE_​EXECUTION_​CAPABILITIES

cl_device_exec_capabilities

Describes the execution capabilities of the device. This is a bit-field that describes one or more of the following values:

CL_​EXEC_​KERNEL - The OpenCL device can execute OpenCL kernels.

CL_​EXEC_​NATIVE_​KERNEL - The OpenCL device can execute native kernels.

The mandated minimum capability is: CL_​EXEC_​KERNEL.

CL_​DEVICE_​QUEUE_​PROPERTIES

Deprecated by version 2.0.

cl_command_queue_properties

See description of CL_​DEVICE_​QUEUE_​ON_​HOST_​PROPERTIES.

CL_​DEVICE_​QUEUE_​ON_​HOST_​PROPERTIES

Missing before version 2.0.

cl_command_queue_properties

Describes the on host command-queue properties supported by the device. This is a bit-field that describes one or more of the following values:

CL_​QUEUE_​OUT_​OF_​ORDER_​EXEC_​MODE_​ENABLE
CL_​QUEUE_​PROFILING_​ENABLE

These properties are described in the Queue Properties table.

The mandated minimum capability is: CL_​QUEUE_​PROFILING_​ENABLE.

CL_​DEVICE_​QUEUE_​ON_​DEVICE_​PROPERTIES

Missing before version 2.0.

cl_command_queue_properties

Describes the on device command-queue properties supported by the device. This is a bit-field that describes one or more of the following values:

CL_​QUEUE_​OUT_​OF_​ORDER_​EXEC_​MODE_​ENABLE
CL_​QUEUE_​PROFILING_​ENABLE

These properties are described in the Queue Properties table.

The mandated minimum capability is: CL_​QUEUE_​OUT_​OF_​ORDER_​EXEC_​MODE_​ENABLE | CL_​QUEUE_​PROFILING_​ENABLE.

CL_​DEVICE_​QUEUE_​ON_​DEVICE_​PREFERRED_​SIZE

Missing before version 2.0.

cl_uint

The size of the device queue in bytes preferred by the implementation. Applications should use this size for the device queue to ensure good performance.

The minimum value is 16 KB

CL_​DEVICE_​QUEUE_​ON_​DEVICE_​MAX_​SIZE

Missing before version 2.0.

cl_uint

The max. size of the device queue in bytes. The minimum value is 256 KB for the full profile and 64 KB for the embedded profile

CL_​DEVICE_​MAX_​ON_​DEVICE_​QUEUES

Missing before version 2.0.

cl_uint

The maximum number of device queues that can be created for this device in a single context.

The minimum value is 1.

CL_​DEVICE_​MAX_​ON_​DEVICE_​EVENTS

Missing before version 2.0.

cl_uint

The maximum number of events in use by a device queue. These refer to events returned by the enqueue_ built-in functions to a device queue or user events returned by the create_user_event built-in function that have not been released.

The minimum value is 1024.

CL_​DEVICE_​BUILT_​IN_​KERNELS

Missing before version 1.2.

char[]

A semi-colon separated list of built-in kernels supported by the device. An empty string is returned if no built-in kernels are supported by the device.

CL_​DEVICE_​PLATFORM

cl_platform_id

The platform associated with this device.

CL_​DEVICE_​NAME

char[]

Device name string.

CL_​DEVICE_​VENDOR

char[]

Vendor name string.

CL_​DRIVER_​VERSION

char[]

OpenCL software driver version string. Follows a vendor-specific format.

CL_​DEVICE_​PROFILE9

char[]

OpenCL profile string. Returns the profile name supported by the device. The profile name returned can be one of the following strings:

FULL_PROFILE - if the device supports the OpenCL specification (functionality defined as part of the core specification and does not require any extensions to be supported).

EMBEDDED_PROFILE - if the device supports the OpenCL embedded profile.

CL_​DEVICE_​VERSION

char[]

OpenCL version string. Returns the OpenCL version supported by the device. This version string has the following format:

OpenCL<space><major_version.minor_version><space><vendor-specific information>

The major_version.minor_version value returned will be one of 1.0, 1.1, 1.2, 2.0, 2.1 or 2.2.

CL_​DEVICE_​OPENCL_​C_​VERSION

Missing before version 1.1.

char[]

OpenCL C version string. Returns the highest OpenCL C version supported by the compiler for this device that is not of type CL_​DEVICE_​TYPE_​CUSTOM. This version string has the following format:

OpenCL<space>C<space><major_version.minor_version><space><vendor-specific information>

The major_version.minor_version value returned must be 2.0 if CL_​DEVICE_​VERSION is OpenCL 2.0, OpenCL 2.1, or OpenCL 2.2.

The major_version.minor_version value returned must be 1.2 if CL_​DEVICE_​VERSION is OpenCL 1.2.

The major_version.minor_version value returned must be 1.1 if CL_​DEVICE_​VERSION is OpenCL 1.1.

The major_version.minor_version value returned can be 1.0 or 1.1 if CL_​DEVICE_​VERSION is OpenCL 1.0.

CL_​DEVICE_​EXTENSIONS

char[]

Returns a space separated list of extension names (the extension names themselves do not contain any spaces) supported by the device. The list of extension names may include Khronos approved extension names and vendor specified extension names.

The following Khronos extension names must be returned by all devices that support OpenCL 1.1:

cl_khr_byte_addressable_store
cl_khr_global_int32_base_atomics
cl_khr_global_int32_extended_atomics
cl_khr_local_int32_base_atomics
cl_khr_local_int32_extended_atomics

Additionally, the following Khronos extension names must be returned by all devices that support OpenCL 1.2:

cl_khr_fp64 (if double precision is supported)

Additionally, the following Khronos extension names must be returned by all devices that support OpenCL 2.0:

cl_khr_3d_image_writes
cl_khr_depth_images
cl_khr_image2d_from_buffer

Please refer to the OpenCL Extension Specification or vendor provided documentation for a detailed description of these extensions.

CL_​DEVICE_​PRINTF_​BUFFER_​SIZE

Missing before version 1.2.

size_t

Maximum size in bytes of the internal buffer that holds the output of printf calls from a kernel. The minimum value for the FULL profile is 1 MB.

CL_​DEVICE_​PREFERRED_​INTEROP_​USER_​SYNC

Missing before version 1.2.

cl_bool

Is CL_​TRUE if the devices preference is for the user to be responsible for synchronization, when sharing memory objects between OpenCL and other APIs such as DirectX, CL_​FALSE if the device / implementation has a performant path for performing synchronization of memory object shared between OpenCL and other APIs such as DirectX.

CL_​DEVICE_​PARENT_​DEVICE

Missing before version 1.2.

cl_device_id

Returns the cl_device_id of the parent device to which this sub-device belongs. If device is a root-level device, a NULL value is returned.

CL_​DEVICE_​PARTITION_​MAX_​SUB_​DEVICES

Missing before version 1.2.

cl_uint

Returns the maximum number of sub-devices that can be created when a device is partitioned.

The value returned cannot exceed CL_​DEVICE_​MAX_​COMPUTE_​UNITS.

CL_​DEVICE_​PARTITION_​PROPERTIES

Missing before version 1.2.

cl_device_partition_ property[]

Returns the list of partition types supported by device. This is an array of cl_device_partition_property values drawn from the following list:

CL_​DEVICE_​PARTITION_​EQUALLY
CL_​DEVICE_​PARTITION_​BY_​COUNTS
CL_​DEVICE_​PARTITION_​BY_​AFFINITY_​DOMAIN

If the device cannot be partitioned (i.e. there is no partitioning scheme supported by the device that will return at least two subdevices), a value of 0 will be returned.

CL_​DEVICE_​PARTITION_​AFFINITY_​DOMAIN

Missing before version 1.2.

cl_device_affinity_ domain

Returns the list of supported affinity domains for partitioning the device using CL_​DEVICE_​PARTITION_​BY_​AFFINITY_​DOMAIN. This is a bit-field that describes one or more of the following values:

CL_​DEVICE_​AFFINITY_​DOMAIN_​NUMA
CL_​DEVICE_​AFFINITY_​DOMAIN_​L4_​CACHE
CL_​DEVICE_​AFFINITY_​DOMAIN_​L3_​CACHE
CL_​DEVICE_​AFFINITY_​DOMAIN_​L2_​CACHE
CL_​DEVICE_​AFFINITY_​DOMAIN_​L1_​CACHE
CL_​DEVICE_​AFFINITY_​DOMAIN_​NEXT_​PARTITIONABLE

If the device does not support any affinity domains, a value of 0 will be returned.

CL_​DEVICE_​PARTITION_​TYPE

Missing before version 1.2.

cl_device_partition_property[]

Returns the properties argument specified in clCreateSubDevices if device is a sub-device. In the case where the properties argument to clCreateSubDevices is CL_​DEVICE_​PARTITION_​BY_​AFFINITY_​DOMAIN, CL_​DEVICE_​AFFINITY_​DOMAIN_​NEXT_​PARTITIONABLE, the affinity domain used to perform the partition will be returned. This can be one of the following values:

CL_​DEVICE_​AFFINITY_​DOMAIN_​NUMA
CL_​DEVICE_​AFFINITY_​DOMAIN_​L4_​CACHE
CL_​DEVICE_​AFFINITY_​DOMAIN_​L3_​CACHE
CL_​DEVICE_​AFFINITY_​DOMAIN_​L2_​CACHE
CL_​DEVICE_​AFFINITY_​DOMAIN_​L1_​CACHE

Otherwise the implementation may either return a param_value_size_ret of 0 i.e. there is no partition type associated with device or can return a property value of 0 (where 0 is used to terminate the partition property list) in the memory that param_value points to.

CL_​DEVICE_​REFERENCE_​COUNT

Missing before version 1.2.

cl_uint

Returns the device reference count. If the device is a root-level device, a reference count of one is returned.

CL_​DEVICE_​SVM_​CAPABILITIES

Missing before version 2.0.

cl_device_svm_capabilities

Describes the various shared virtual memory (a.k.a. SVM) memory allocation types the device supports. Coarse-grain SVM allocations are required to be supported by all OpenCL 2.0 devices. This is a bit-field that describes a combination of the following values:

CL_​DEVICE_​SVM_​COARSE_​GRAIN_​BUFFER - Support for coarse-grain buffer sharing using clSVMAlloc. Memory consistency is guaranteed at synchronization points and the host must use calls to clEnqueueMapBuffer and clEnqueueUnmapMemObject.

CL_​DEVICE_​SVM_​FINE_​GRAIN_​BUFFER - Support for fine-grain buffer sharing using clSVMAlloc. Memory consistency is guaranteed at synchronization points without need for clEnqueueMapBuffer and clEnqueueUnmapMemObject.

CL_​DEVICE_​SVM_​FINE_​GRAIN_​SYSTEM - Support for sharing the host’s entire virtual memory including memory allocated using malloc. Memory consistency is guaranteed at synchronization points.

CL_​DEVICE_​SVM_​ATOMICS - Support for the OpenCL 2.0 atomic operations that provide memory consistency across the host and all OpenCL devices supporting fine-grain SVM allocations.

The mandated minimum capability is CL_​DEVICE_​SVM_​COARSE_​GRAIN_​BUFFER.

CL_​DEVICE_​PREFERRED_​PLATFORM_​ATOMIC_​ALIGNMENT

Missing before version 2.0.

cl_uint

Returns the value representing the preferred alignment in bytes for OpenCL 2.0 fine-grained SVM atomic types. This query can return 0 which indicates that the preferred alignment is aligned to the natural size of the type.

CL_​DEVICE_​PREFERRED_​GLOBAL_​ATOMIC_​ALIGNMENT

Missing before version 2.0.

cl_uint

Returns the value representing the preferred alignment in bytes for OpenCL 2.0 atomic types to global memory. This query can return 0 which indicates that the preferred alignment is aligned to the natural size of the type.

CL_​DEVICE_​PREFERRED_​LOCAL_​ATOMIC_​ALIGNMENT

Missing before version 2.0.

cl_uint

Returns the value representing the preferred alignment in bytes for OpenCL 2.0 atomic types to local memory. This query can return 0 which indicates that the preferred alignment is aligned to the natural size of the type.

CL_​DEVICE_​MAX_​NUM_​SUB_​GROUPS

Missing before version 2.1.

cl_uint

Maximum number of sub-groups in a work-group that a device is capable of executing on a single compute unit, for any given kernel-instance running on the device. The minimum value is 1. (Refer also to clGetKernelSubGroupInfo.)

CL_​DEVICE_​SUB_​GROUP_​INDEPENDENT_​FORWARD_​PROGRESS

Missing before version 2.1.

cl_bool

Is CL_​TRUE if this device supports independent forward progress of sub-groups, CL_​FALSE otherwise. If cl_khr_subgroups is supported by the device this must return CL_​TRUE.

4

OpenCL adopters must report a valid vendor ID for their implementation. If there is no valid PCI vendor ID defined for the physical device, implementations must obtain a Khronos vendor ID. This is a unique identifier greater than the largest PCI vendor ID(0x10000) and is representable by a cl_uint. Khronos vendor IDs are synchronized across APIs by utilizing Vulkan’s vk.xml as the central Khronos vendor ID registry. An ID must be reserved here prior to use in OpenCL, regardless of whether a vendor implements Vulkan. Only once the ID has been allotted may it be exposed to OpenCL by proposing a merge request against cl.xml, in the master branch of the OpenCL-Docs project. The merge must define a new enumerant by adding an <enum> tag to the cl_khronos_vendor_id <enums> tag, with the <value> attribute set as the acquired Khronos vendor ID. The <name> attribute must identify the vendor/adopter, and be of the form CL_KHRONOS_VENDOR_ID_<vendor>.

5

A kernel that uses an image argument with the write_only or read_write image qualifier may result in additional read_only images resources being created internally by an implementation. The internally created read_only image resources will count against the max supported read image arguments given by CL_​DEVICE_​MAX_​READ_​IMAGE_​ARGS. Enqueuing a kernel that requires more images than the implementation can support will result in a CL_​OUT_​OF_​RESOURCES error being returned.

6

NOTE: CL_​DEVICE_​MAX_​WRITE_​IMAGE_​ARGS is only there for backward compatibility. CL_​DEVICE_​MAX_​READ_​WRITE_​IMAGE_​ARGS should be used instead.

7

The optional rounding modes should be included as a device capability only if it is supported natively. All explicit conversion functions with specific rounding modes must still operate correctly.

8

The optional rounding modes should be included as a device capability only if it is supported natively. All explicit conversion functions with specific rounding modes must still operate correctly.

9

The platform profile returns the profile that is implemented by the OpenCL framework. If the platform profile returned is FULL_PROFILE, the OpenCL framework will support devices that are FULL_PROFILE and may also support devices that are EMBEDDED_PROFILE. The compiler must be available for all devices i.e. CL_​DEVICE_​COMPILER_​AVAILABLE is CL_​TRUE. If the platform profile returned is EMBEDDED_PROFILE, then devices that are only EMBEDDED_PROFILE are supported.

clGetDeviceInfo returns CL_​SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:

  • CL_​INVALID_​DEVICE if device is not a valid device.

  • CL_​INVALID_​VALUE if param_name is not one of the supported values or if size in bytes specified by param_value_size is < size of return type as specified in the Device Queries table and param_value is not a NULL value or if param_name is a value that is available as an extension and the corresponding extension is not supported by the device.

  • CL_​OUT_​OF_​RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

  • CL_​OUT_​OF_​HOST_​MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

See Also

Document Notes

For more information, see the OpenCL Specification

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

Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.