OpenCL™规范 4.2. 查询设备

4.2. Querying Devices

4.2. 查询设备

The list of devices available on a platform can be obtained using the function [5]:

​可以使用函数[5]获得平台上可用的设备列表:

cl_int clGetDeviceIDs(
    cl_platform_id platform,
    cl_device_type device_type,
    cl_uint num_entries,
    cl_device_id* devices,
    cl_uint* num_devices);
  • platform refers to the platform ID returned by clGetPlatformIDs or can be NULL. If platform is NULL, the behavior is implementation-defined.

  • ​platform是指clGetPlatformID返回的平台ID,也可以为NULL。若平台为NULL,则行为由实现定义。

  • device_type is a bitfield that identifies the type of OpenCL device. The device_type can be used to query specific OpenCL devices or all OpenCL devices available. The valid values for device_type are specified in the Device Types table.

  • ​device_type是一个位字段,用于标识OpenCL设备的类型。device_type可用于查询特定OpenCL设备或所有可用的OpenCL设备。device_type的有效值在“设备类型”表中指定。

  • num_entries is the number of cl_device_id entries that can be added to devices. If devices is not NULL, the num_entries must be greater than zero.

  • num_entries是可以添加到设备的cl_device_id条目的数量。如果设备不为NULL,则num_entries必须大于零。

  • devices returns a list of OpenCL devices found. The cl_device_id values returned in devices can be used to identify a specific OpenCL device. If devices is NULL, this argument is ignored. The number of OpenCL devices returned is the minimum of the value specified by num_entries or the number of OpenCL devices whose type matches device_type.

  • devices返回找到的OpenCL设备的列表。设备中返回的cl_device_id值可用于标识特定的OpenCL设备。如果设备为NULL,则忽略此参数。返回的OpenCL设备数是num_entries指定的值的最小值,或者是类型与device_type匹配的OpenCL装置数。

  • num_devices returns the number of OpenCL devices available that match device_type. If num_devices is NULL, this argument is ignored.

  • num_devices返回与device_type匹配的可用OpenCL设备的数量。如果num_devices为NULL,则忽略此参数。

Table 4. List of supported device_types by clGetDeviceIDs

表4 clGetDeviceID支持的设备类型列表

Device Type

设备类型

Description

描述

CL_DEVICE_TYPE_CPU

An OpenCL device similar to a traditional CPU (Central Processing Unit). The host processor that executes OpenCL host code may also be considered a CPU OpenCL device.

一种类似于传统CPU(中央处理器)的OpenCL设备。执行OpenCL主机代码的主机处理器也可以被认为是CPU OpenCL设备。

CL_DEVICE_TYPE_GPU

An OpenCL device similar to a GPU (Graphics Processing Unit). Many systems include a dedicated processor for graphics or rendering that may be considered a GPU OpenCL device.

一种类似于GPU(图形处理单元)的OpenCL设备。许多系统包括用于图形或渲染的专用处理器,其可以被认为是GPU OpenCL设备。

CL_DEVICE_TYPE_ACCELERATOR

Dedicated devices that may accelerate OpenCL programs, such as FPGAs (Field Programmable Gate Arrays), DSPs (Digital Signal Processors), or AI (Artificial Intelligence) processors.

可以加速OpenCL程序的专用设备,如FPGA(现场可编程门阵列)、DSP(数字信号处理器)或AI(人工智能)处理器。

CL_DEVICE_TYPE_CUSTOM

missing before version 1.2.

Specialized devices that implement some of the OpenCL runtime APIs but do not support all required OpenCL functionality.

实现一些OpenCL运行时API但不支持所有必需的OpenCL功能的专用设备。

CL_DEVICE_TYPE_DEFAULT

The default OpenCL device in the platform. The default OpenCL device must not be a CL_DEVICE_TYPE_CUSTOM device.

平台中默认的OpenCL设备。默认的OpenCL设备不能是CL_device_TYPE_CUSTOM设备。

CL_DEVICE_TYPE_ALL

All OpenCL devices available in the platform, except for CL_DEVICE_TYPE_CUSTOM devices.

平台中所有可用的OpenCL设备,CL_DEVICE_TYPE_CUSTOM设备除外。

The device type is purely informational and has no semantic meaning.

设备类型纯粹是信息性的,没有语义意义。

Some devices may be more than one type. For example, a CL_DEVICE_TYPE_CPU device may also be a CL_DEVICE_TYPE_GPU device, or a CL_DEVICE_TYPE_ACCELERATOR device may also be some other, more descriptive device type. CL_DEVICE_TYPE_CUSTOM devices must not be combined with any other device types.

​某些设备可能有多种类型。例如,CL_DEVICE_TYPE_CPU设备也可以是CL_DEVICE_TYPE_GPU设备,或者CL_DEVICS_TYPE_ACCELERATOR设备也可以为一些其他的、更具描述性的设备类型。CL_DEVICE_TYPE_CUSTOM设备不得与任何其他设备类型组合使用。

One device in the platform should be a CL_DEVICE_TYPE_DEFAULT device. The default device should also be a more specific device type, such as CL_DEVICE_TYPE_CPU or CL_DEVICE_TYPE_GPU.

​平台中的一个设备应该是CL_DEVICE_TYPE_DEFAULT设备。默认设备也应该是更具体的设备类型,如CL_DEVICE_TYPE_CPU或CL_DEVICE_TYPE_GPU。

clGetDeviceIDs returns CL_SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:

如果函数执行成功,clGetDeviceID将返回CL_SUCCESS。否则,它将返回以下错误之一:

  • CL_INVALID_PLATFORM if platform is not a valid platform.

  • CL_INVALID_PLATFORM(如果平台不是有效平台)。

  • CL_INVALID_DEVICE_TYPE if device_type is not a valid value.

  • CL_INVALID_DEVICE_TYPE(如果设备类型不是有效值)。

  • CL_INVALID_VALUE if num_entries is equal to zero and devices is not NULL or if both num_devices and devices are NULL.

  • 如果num_entries等于零并且设备不为NULL,或者如果num_devices和devices都为NULL,则CL_INVALID_VALUE。

  • CL_DEVICE_NOT_FOUND if no OpenCL devices that matched device_type were found.

  • .如果未找到与device_type匹配的OpenCL设备,则为CL_DEVICE_NOT_FOUND。

  • CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

  • CL_OUT_OF_RESOURCES,如果在设备上分配OpenCL实现所需的资源失败。

  • CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

  • CL_OUT_OF_HOST_MEMORY,如果在主机上分配OpenCL实现所需的资源失败。

The application can query specific capabilities of the OpenCL device(s) returned by clGetDeviceIDs. This can be used by the application to determine which device(s) to use.

​应用程序可以查询clGetDeviceID返回的OpenCL设备的特定功能。这可以由应用程序用来确定要使用的设备。

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

要获取有关OpenCL设备的特定信息,请调用函数:

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);
  • 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.

  • ​设备可以是clGetDeviceID返回的设备,也可以是clCreateSubDevices创建的子设备。如果设备是子设备,则会返回该子设备的具体信息。可以使用clGetDeviceInfo查询的信息在“设备查询”表中指定。

  • 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_name是一个枚举常量,用于标识要查询的设备信息。它可以是“设备查询”表中指定的以下值之一。

  • 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是指向内存位置的指针,在该位置将返回设备查询表中指定的给定param_name的适当值。如果param_value为NULL,则忽略它。

  • 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指定param_value指向的内存大小(以字节为单位)。此大小(以字节为单位)必须≥设备查询表中指定的返回类型的大小。

  • 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.

  • param_value_size_ret返回param_name查询的数据的实际大小(以字节为单位)。如果param_value_size_ret为NULL,则忽略它。

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:

​设备查询表中描述的设备查询应返回与根级设备相同的信息,即clGetDeviceID返回的设备和从此设备创建的任何子设备,以下查询除外:

Table 5. List of supported param_names by clGetDeviceInfo
表5 clGetDeviceInfo支持的参数名称列表

Device InfoReturn TypeDescription

CL_DEVICE_TYPE

cl_device_type

The type or types of the OpenCL device.

Please see the Device Types table for supported device types and device type combinations.

OpenCL设备的类型。
有关支持的设备类型和设备类型组合,请参阅设备类型表。

CL_DEVICE_VENDOR_ID [6]

cl_uint

A unique device vendor identifier.

If the vendor has a PCI vendor ID, the low 16 bits must contain that PCI vendor ID, and the remaining bits must be set to zero. Otherwise, the value returned must be a valid Khronos vendor ID represented by type cl_khronos_vendor_id. Khronos vendor IDs are allocated starting at 0x10000, to distinguish them from the PCI vendor ID namespace.

唯一的设备供应商标识符。如果供应商有PCI供应商ID,则低16位必须包含该PCI供应商ID。其余位必须设置为零。否则,返回的值必须是由类型cl_khronos_vendor_id表示的有效Khronos供应商ID。Khronos的供应商ID从0x10000开始分配,以将其与PCI供应商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.

OpenCL设备上并行计算单元的数量。工作组在单个计算单元上执行。最小值为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.

指定数据并行执行模型使用的全局和本地工作项ID的最大维度。(请参阅clEnqueueNDRangeKernel)。对于非CL_DEVICE_type_CUSTOM类型的设备,最小值为3。

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.

在工作组的每个维度中可以指定给clEnqueueNDRangeKernel的最大工作项数。
返回n个size_t条目,其中n是查询CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS返回的值。
对于非CL_DEVICE_type_CUSTOM类型的设备,最小值为(1,1,1)。

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).

​对于在设备上运行的任何给定内核实例,设备能够在单个计算单元上执行的工作组中的最大工作项数。(另请参阅clEnqueueNDRangeKernel和CL_KERNEL_WORK_GROUP _SIZE)。最小值为1。返回的值是一个上限,不一定会使性能最大化。此最大值可能大于特定内核所支持的值(请参阅clGetKernelWorkGroupInfo的CL_KERNEL_WORK_GROUP_SIZE_SIZE查询)。

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_PREFERRED_VECTOR_WIDTH_DOUBLE必须返回0。
如果不支持cl_khr_fp16扩展,则CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF必须返回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.

返回本地ISA矢量宽度。矢量宽度定义为可以存储在矢量中的标量元素的数量。
如果不支持双精度,CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE必须返回0。
如果不支持cl_khr_fp16扩展,则CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF必须返回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.

​设备的时钟频率(MHz)。此值的含义由实现定义。对于具有多个时钟域的设备,可以返回任何时钟域中的时钟频率。对于由于功率或热原因而动态改变频率的设备,返回的时钟频率可以是任何有效频率。注:此定义在版本2.2之前丢失。
设备的最大配置时钟频率(MHz)。注意:此定义已被版本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.

全局地址空间的默认计算设备地址空间大小,指定为以位为单位的无符号整数值。当前支持的值为32或64位。

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_TYPE_CUSTOM类型的设备,最小值为max(min(1024 × 1024 × 1024, 1/4th of CL_DEVICE_GLOBAL_MEM_SIZE), 32 × 1024 × 1024)。

CL_DEVICE_IMAGE_SUPPORT

cl_bool

Is CL_TRUE if images are supported by the OpenCL device and CL_FALSE otherwise.

​如果OpenCL设备支持图像,则为CL_TRUE,否则为CL_FALSE。

CL_DEVICE_MAX_READ_IMAGE_ARGS [7]

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.


使用read_only限定符声明的内核的图像对象参数的最大数目。如果CL_DEVICE_IMAGE_SUPPORT为CL_TRUE,则最小值为128,否则为0。

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.

使用write_only限定符声明的内核的映像对象参数的最大数目。如果CL_DEVICE_IMAGE_SUPPORT为CL_TRUE,则最小值为64,否则为0。

CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS

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.

Support for read-write image arguments is required for an OpenCL 2.0, 2.1, or 2.2 device if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE.

The minimum value is 64 if the device supports read-write images arguments, and must be 0 for devices that do not support read-write images.

使用write_only或read_write限定符声明的内核的图像对象参数的最大数目。
如果CL_DEVICE_IMAGE_SUPPORT为CL_TRUE,则OpenCL 2.0、2.1或2.2设备需要支持读写映像参数。
如果设备支持读写映像参数,则最小值为64;对于不支持读写映象的设备,则最小为0。

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 an OpenCL 2.1 or 2.2 device, SPIR-V is a required IL prefix.

If the device does not support intermediate language programs, the value must be "" (an empty string).

此设备的clCreateProgramWithIL可以支持的中间语言。返回以空格分隔的IL版本字符串列表,格式为<IL_Prefix>_<Major_Version>.<Minor_Version>。
对于OpenCL 2.1或2.2设备,SPIR-V是必需的IL前缀。
如果设备不支持中间语言程序,则值必须为“”(空字符串)。

CL_DEVICE_ILS_WITH_VERSION

missing before version 3.0. Also see extension cl_khr_il_program.

cl_name_version[]

Returns an array of descriptions (name and version) for all supported intermediate languages. Intermediate languages with the same name may be reported more than once but each name and major/minor version combination may only be reported once. The list of intermediate languages reported must match the list reported via CL_DEVICE_IL_VERSION.

For an OpenCL 2.1 or 2.2 device, at least one version of SPIR-V must be reported.

返回所有支持的中间语言的描述(名称和版本)数组。具有相同名称的中间语言可以多次报告,但每个名称和主要/次要版本组合只能报告一次。报告的中间语言列表必须与通过CL_DEVICE_IL_VERSION报告的列表相匹配。
对于OpenCL 2.1或2.2设备,必须报告至少一个版本的SPIR-V。

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.

不是从缓冲对象创建的2D图像或1D图像的最大宽度(以像素为单位)。
如果CL_DEVICE_IMAGE_SUPPORT为CL_TRUE,则最小值为16384,否则为0。

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.

2D图像的最大高度(以像素为单位)。
如果CL_DEVICE_IMAGE_SUPPORT为CL_TRUE,则最小值为16384,否则为0。

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.


3D图像的最大宽度(以像素为单位)。
如果CL_DEVICE_IMAGE_SUPPORT为CL_TRUE,则最小值为2048,否则为0。

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.

3D图像的最大高度(以像素为单位)。
如果CL_DEVICE_IMAGE_SUPPORT为CL_TRUE,则最小值为2048,否则为0。

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.

3D图像的最大深度(以像素为单位)。
如果CL_DEVICE_IMAGE_SUPPORT为CL_TRUE,则最小值为2048,否则为0。

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.

从缓冲区对象创建的1D图像的最大像素数。
如果CL_DEVICE_IMAGE_SUPPORT为CL_TRUE,则最小值为65536,否则为0。

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.

​1D或2D图像阵列中的最大图像数。
如果CL_DEVICE_IMAGE_SUPPORT为CL_TRUE,则最小值为2048,否则为0。

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_SUPPORT为CL_TRUE,则最小值为16,否则为0。

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.

Support for 2D images created from a buffer is required for an OpenCL 2.0, 2.1, or 2.2 device if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE.

This value must be 0 for devices that do not support 2D images created from a buffer.

从缓冲区创建的2D图像的行间距对齐大小(以像素为单位)。返回的值必须是2的幂。
如果CL_DEVICE_IMAGE_SUPPORT为CL_TRUE,则OpenCL 2.0、2.1或2.2设备需要支持从缓冲区创建的2D图像。
对于不支持从缓冲区创建的2D图像的设备,此值必须为0。

CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT

missing before version 2.0.

cl_uint

This query specifies the minimum alignment in pixels of the host_ptr specified to clCreateBuffer or clCreateBufferWithProperties 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.

Support for 2D images created from a buffer is required for an OpenCL 2.0, 2.1, or 2.2 device if CL_DEVICE_IMAGE_SUPPORT is CL_TRUE.

This value must be 0 for devices that do not support 2D images created from a buffer.


当从使用CL_MEM_USE_HOST_PTR创建的缓冲区创建2D图像时,此查询指定指定给clCreateBuffer或clCreateBufferWithProperties的host_ptr的最小对齐(以像素为单位)。返回的值必须是2的幂。
如果CL_DEVICE_IMAGE_SUPPORT为CL_TRUE,则OpenCL 2.0、2.1或2.2设备需要支持从缓冲区创建的2D图像。
对于不支持从缓冲区创建的2D图像的设备,此值必须为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 for devices supporting pipes, and must be 0 for devices that do not support pipes.

可以作为参数传递给内核的管道对象的最大数量。支持管道的设备的最小值为16,不支持管道的装置的最小值必须为0。

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 for devices supporting pipes, and must be 0 for devices that do not support pipes.

内核中每个工作项可以为管道激活的最大保留数。一个工作组预订被视为每个工作项一个预订。支持管道的设备的最小值为1,不支持管道的装置的最小值必须为0。

CL_DEVICE_PIPE_MAX_PACKET_SIZE

missing before version 2.0.

cl_uint

The maximum size of pipe packet in bytes.

Support for pipes is required for an OpenCL 2.0, 2.1, or 2.2 device. The minimum value is 1024 bytes if the device supports pipes, and must be 0 for devices that do not support pipes.

管道数据包的最大大小(以字节为单位)。
OpenCL 2.0、2.1或2.2设备需要管道支撑。如果设备支持管道,最小值为1024字节;对于不支持管道的设备,最小值必须为0。

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. For all other values, a maximum of 255 arguments can be passed to a kernel.

可以传递给内核的所有参数的最大大小(以字节为单位)。
对于非CL_DEVICE_TYPE_CUSTOM类型的设备,最小值为1024。对于这个最小值,最多只能向内核传递128个参数。对于所有其他值,最多可以向内核传递255个参数。

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_TYPE_CUSTOM类型的设备,最小值是设备支持的最大OpenCL内置数据类型的大小(以位为单位)(FULL配置文件中的long16,EMBEDED配置文件中为long16或int16)。

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).

最小值是设备支持的最大OpenCL数据类型的大小(以字节为单位)(FULL配置文件中为long16,EMBEDED配置文件中的long16或int16)。

CL_DEVICE_SINGLE_FP_CONFIG [8]

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_FP_DENORM-支持分母
CL_FP_INF_NAMEN-支持INF和安静NAN
​​​​​​​ CL_FP_ROUND_TO_NEAREST-支持四舍五入的偶数舍入模式
CL_FP_PROUND_TO_ZERO-支持四入零舍入模式
CL-FP_ROUND_TO_INF-支持正和负无穷大舍入模式CL_FP_FMA-支持IEEE754-2008融合乘法加法
CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT-除法和SQRT
按照IEEE754规范的定义正确取整CL_FP_SOFT_FLOAT-基本浮点运算(如加法、减法、乘法)在软件中实现
对于完整配置,非CL_DEVICE_TYPE_CUSTOM类型的设备的强制最小浮点功能为:
CL_FP_ROUND_TO_NEAREST|
CL_FP_INF_NAN。
有关嵌入的配置文件,请参阅专用表格。

CL_DEVICE_DOUBLE_FP_CONFIG [8]

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 for OpenCL 2.0 or newer devices is:

CL_FP_FMA |
CL_FP_ROUND_TO_NEAREST |
CL_FP_INF_NAN |
CL_FP_DENORM.

or for OpenCL 1.0, OpenCL 1.1 or OpenCL 1.2 devices:

CL_FP_FMA |
CL_FP_ROUND_TO_NEAREST |
CL_FP_ROUND_TO_ZERO |
CL_FP_ROUND_TO_INF |
CL_FP_INF_NAN |
CL_FP_DENORM.

描述OpenCL设备的双精度浮点功能。这是一个位字段,用于描述以下一个或多个值:
CL_FP_DENORM-支持分母
CL_FP_INF_NAMEN-支持INF和NAN
CL_FP_ROUND_TO_NEAREST-支持四舍五入的偶数舍入模式
CL_FP_PROUND_TO_ZERO-支持四舍入到零舍入模式
CL-FP_ROUND_TO_INF-支持正和负无穷大舍入模式
CL_FP_FMA-支持IEEE754-2008融合乘法-
CL_FP_SOFT_FLOAT-基本浮点运算(如加法、减法、乘法)在软件中实现

双精度是一个可选功能,因此强制的最小双精度浮点功能为0。
如果设备支持双精度,则OpenCL 2.0或更新设备的最小双精度浮点功能为:
CL_FP_FMA|
CL_FP_ROUND_TO_NEAREST|
CL_FP_INF_NAN|
CL_FP_DENORM。
或者对于OpenCL 1.0、OpenCL 1.1或OpenCL 1.2设备:
CL_FP_FMA|
CL_FP_ROUND_TO_NEAREST|
CL_FP_ROUND_TO_ZERO|
CL_FP_ROUND_TO_INF|
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_NONECL_READ_ONLY_CACHE, and CL_READ_WRITE_CACHE.

支持的全局内存缓存类型。有效值为:CL_NONE、CL_READ_ONLY_CACHE和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_TYPE_CUSTOM类型的设备,最小值为64 KB。

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.


内核中使用__constant限定符声明的最大参数数。对于非CL_DEVICE_TYPE_CUSTOM类型的设备,最小值为8。

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.

Support for program scope global variables is required for an OpenCL 2.0, 2.1, or 2.2 device. The minimum value is 64 KB if the device supports program scope global variables, and must be 0 for devices that do not support program scope global variables.

在全局地址空间中声明的OpenCL内核语言中,可以为程序范围内或函数内的任何单个变量分配的最大存储字节数。
OpenCL 2.0、2.1或2.2设备需要支持程序范围全局变量。如果设备支持程序范围全局变量,最小值为64 KB;对于不支持程序范围全球变量的设备,最小值必须为0。

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.

全局地址空间中所有程序变量的最大首选总大小(以字节为单位)。这是一个性能提示。一种实现方式可以将这样的变量放置在具有优化的设备访问的存储器中。此查询返回此类存储的容量。最小值为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_LOCAL,意味着专用的本地存储器存储,例如SRAM或CL_GLOBAL。
对于自定义设备,还可以返回CL_NONE,指示不支持本地内存。

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_TYPE_CUSTOM类型的设备,最小值为32 KB。

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_TRUE。如果设备没有实现这样的纠错,则为CL_FALSE。

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_TRUE,否则为CL_FALSE。

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

如果OpenCL设备是小端设备,则为CL_TRUE,否则为CL_FALSE

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_TRUE,否则为CL_FALSE。如果可以期望设备成功执行排队到设备的命令,则该设备被认为是可用的。

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_FALSE。
如果编译器可用,则为CL_TRUE。这只能是用于嵌入式平台配置文件的CL_FALSE。

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_FALSE。如果链接器可用,则为CL_TRUE。
这只能是用于嵌入式平台配置的CL_FALSE。
如果CL_DEVICE_COMPILER_AVAILABLE为CL_TRUE,则该值必须为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_EXEC_KERNEL-OpenCL设备可以执行OpenCL内核。
CL_EXEC_NATIVE_KERNEL-OpenCL设备可以执行本机内核。
规定的最低能力为: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的说明。

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_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE CL_QUEUE_PROFILING_ENABLE
队列属性表中介绍了这些属性。
规定的最低功能为: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.

Support for on-device queues is required for an OpenCL 2.0, 2.1, or 2.2 device. When on-device queues are supported, the mandated minimum capability is:

CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
CL_QUEUE_PROFILING_ENABLE.

Must be 0 for devices that do not support on-device queues.

描述设备支持的设备上命令队列属性。这是一个位字段,用于描述以下一个或多个值:
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE CL_QUEUE_PROFILING_ENABLE
队列属性表中介绍了这些属性。
OpenCL 2.0、2.1或2.2设备需要支持设备上队列。当支持设备上队列时,规定的最低功能是:
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE|
CL_QUEUE_PROFILING_ENABLE。
对于不支持设备上队列的设备,必须为0。

CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE

missing before version 2.0.

cl_uint

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

The minimum value is 16 KB for devices supporting on-device queues, and must be 0 for devices that do not support on-device queues.

设备队列的首选大小,以字节为单位。应用程序应将此大小用于设备队列,以确保良好的性能。
对于支持设备上队列的设备,最小值为16 KB,对于不支持设备上排队的设备,必须为0。

CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE

missing before version 2.0.

cl_uint

The maximum size of the device queue in bytes.

The minimum value is 256 KB for the full profile and 64 KB for the embedded profile for devices supporting on-device queues, and must be 0 for devices that do not support on-device queues.

设备队列的最大大小(以字节为单位)。
对于支持设备上队列的设备,完整配置文件的最小值为256 KB,嵌入式配置文件的最大值为64 KB,对于不支持设备上排队的设备,最小值必须为0。

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 for devices supporting on-device queues, and must be 0 for devices that do not support on-device queues.

在单个上下文中可以为此设备创建的最大设备队列数。对于支持设备上队列的设备,最小值为1,对于不支持设备上排队的设备,必须为0。

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 for devices supporting on-device queues, and must be 0 for devices that do not support on-device queues.

设备队列正在使用的最大事件数。这些是指enqueue_内置函数返回到设备队列的事件,或者是create_user_event内置函数返回的尚未发布的用户事件。
对于支持设备上队列的设备,最小值为1024,对于不支持设备上排队的设备,必须为0。

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_BUILT_IN_KERNELS_WITH_VERSION

missing before version 3.0.

cl_name_version[]

Returns an array of descriptions for the built-in kernels supported by the device. Each built-in kernel may only be reported once. The list of reported kernels must match the list returned via CL_DEVICE_BUILT_IN_KERNELS.

返回设备支持的内置内核的描述数组。每个内置内核只能报告一次。报告的内核列表必须与通过CL_DEVICE_BUILT_IN_KERNELS返回的列表匹配。

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.

OpenCL软件驱动程序版本字符串。遵循供应商特定的格式。

CL_DEVICE_PROFILE

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.

OpenCL配置字符串。返回设备支持的配置名称。返回的配置名称可以是以下字符串之一:
FULL_PROFILE-如果设备支持OpenCL规范(功能定义为核心规范的一部分,不需要支持任何扩展)。
EMBEDDED_PROFILE-如果设备支持OpenCL嵌入式配置。

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, 2.2, or 3.0.

OpenCL版本字符串。返回设备支持的OpenCL版本。此版本字符串具有以下格式:
OpenCL<space><major_version.minor_version><space>><供应商特定信息>
返回的major_version.minor_version值将是1.0、1.1、1.2、2.0、2.1、2.2或3.0之一。

CL_DEVICE_NUMERIC_VERSION

missing before version 3.0.

cl_version

Returns the detailed (major, minor, patch) version supported by the device. The major and minor version numbers returned must match those returned via CL_DEVICE_VERSION.

返回设备支持的详细版本(主要、次要、修补程序)。返回的主要版本号和次要版本号必须与通过CL_DEVICE_VERSION返回的版本号相匹配。

CL_DEVICE_OPENCL_C_VERSION

missing before version 1.1 and deprecated by version 3.0.

char[]

Returns the highest fully backwards compatible OpenCL C version supported by the compiler for the device. For devices supporting compilation from OpenCL C source, this will return a version string with the following format:

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

返回设备的编译器支持的最高完全向后兼容的OpenCL C版本。对于支持从OpenCL C源代码编译的设备,这将返回以下格式的版本字符串:
OpenCL<space>C<space><major_version.minor_version><space><供应商特定信息>

For devices that support compilation from OpenCL C source:

对于支持从OpenCL C源代码进行编译的设备:

Because OpenCL 3.0 is backwards compatible with OpenCL C 1.2, an OpenCL 3.0 device must support at least OpenCL C 1.2. An OpenCL 3.0 device may return an OpenCL C version newer than OpenCL C 1.2 if and only if all optional OpenCL C features are supported by the device for the newer version.

由于OpenCL 3.0与OpenCL C 1.2向后兼容,因此OpenCL 3.0设备必须至少支持OpenCL C 1.2。如果且仅当设备支持所有可选的OpenCL C功能用于新版本时,OpenCL 3.0设备可以返回比OpenCL C 1.2更新的OpenCL C.版本。

Support for OpenCL C 2.0 is required for an OpenCL 2.0, OpenCL 2.1, or OpenCL 2.2 device.

OpenCL 2.0、OpenCL 2.1或OpenCL 2.2设备需要支持OpenCL C 2.0。

Support for OpenCL C 1.2 is required for an OpenCL 1.2 device.

OpenCL 1.2设备需要支持OpenCL C 1.2。

Support for OpenCL C 1.1 is required for an OpenCL 1.1 device.

OpenCL 1.1设备需要支持OpenCL C 1.1。

Support for either OpenCL C 1.0 or OpenCL C 1.1 is required for an OpenCL 1.0 device.

OpenCL 1.0设备需要支持OpenCL C 1.0或OpenCL C 1.1。

For devices that do not support compilation from OpenCL C source, such as when CL_DEVICE_COMPILER_AVAILABLE is CL_FALSE, this query may return an empty string.

对于不支持从OpenCL C源进行编译的设备,例如当CL_DEVICE_COMPILER_AVAILABLE为CL_FALSE时,此查询可能会返回一个空字符串。

This query has been superseded by the CL_DEVICE_OPENCL_C_ALL_VERSIONS query, which returns a set of OpenCL C versions supported by a device.

此查询已被CL_DEVICE_OPENCL_C_ALL_VERSIONS查询取代,该查询返回设备支持的一组OPENCL C版本。

CL_DEVICE_OPENCL_C_ALL_VERSIONS

missing before version 3.0.

cl_name_version[]

Returns an array of name, version descriptions listing all the versions of OpenCL C supported by the compiler for the device. In each returned description structure, the name field is required to be "OpenCL C". The list may include both newer non-backwards compatible OpenCL C versions, such as OpenCL C 3.0, and older OpenCL C versions with mandatory backwards compatibility. The version returned by CL_DEVICE_OPENCL_C_VERSION is required to be present in the list.

​返回一个名称、版本描述的数组,其中列出了设备的编译器支持的OpenCL C的所有版本。在每个返回的描述结构中,名称字段都要求为“OpenCL C”。该列表可以包括较新的非向后兼容的OpenCL C版本,例如OpenCL C 3.0,以及具有强制性向后兼容性的较旧的OpenCL C版本。CL_DEVICE_OPENCL_C_VERSION返回的版本必须存在于列表中。

For devices that support compilation from OpenCL C source:

对于支持从OpenCL C源代码进行编译的设备:

Because OpenCL 3.0 is backwards compatible with OpenCL C 1.2, and OpenCL C 1.2 is backwards compatible with OpenCL C 1.1 and OpenCL C 1.0, support for at least OpenCL C 3.0, OpenCL C 1.2, OpenCL C 1.1, and OpenCL C 1.0 is required for an OpenCL 3.0 device.

由于OpenCL 3.0与OpenCL C 1.2向后兼容,并且OpenCL C 1.2OpenCL C 1.1和OpenCL C 1.0向后兼容,因此OpenCL 3.0设备至少需要支持OpenCL C 3.0、OpenCL C 1.2。

Support for OpenCL C 2.0, OpenCL C 1.2, OpenCL C 1.1, and OpenCL C 1.0 is required for an OpenCL 2.0, OpenCL 2.1, or OpenCL 2.2 device.

OpenCL 2.0、OpenCL 2.1或OpenCL 2.2设备需要支持OpenCL C 2.0、OpenCL C 1.2、OpenCL C 1.1和OpenCL C 1.0。

Support for OpenCL C 1.2, OpenCL C 1.1, and OpenCL C 1.0 is required for an OpenCL 1.2 device.

OpenCL 1.2设备需要支持OpenCL C 1.2、OpenCL C 1.1和OpenCL C 1.0。

Support for OpenCL C 1.1 and OpenCL C 1.0 is required for an OpenCL 1.1 device.

OpenCL 1.1设备需要支持OpenCL C 1.1和OpenCL C 1.0。

Support for at least OpenCL C 1.0 is required for an OpenCL 1.0 device.

OpenCL 1.0设备需要至少支持OpenCL C 1.0。

For devices that do not support compilation from OpenCL C source, this query may return an empty array.

对于不支持从OpenCLC源代码编译的设备,此查询可能返回一个空数组。

CL_DEVICE_OPENCL_C_FEATURES

missing before version 3.0.

cl_name_version[]

Returns an array of optional OpenCL C features supported by the compiler for the device alongside the OpenCL C version that introduced the feature macro. For example, if a compiler supports an OpenCL C 3.0 feature, the returned name will be the full name of the OpenCL C feature macro, and the returned version will be 3.0.0.

返回设备的编译器支持的可选OpenCL C功能的数组,以及引入该功能宏的OpenCL C版本。例如,如果编译器支持OpenCL C 3.0功能,则返回的名称将是OpenCL C功能宏的全名,返回的版本将是3.0.0。

For devices that do not support compilation from OpenCL C source, this query may return an empty array.

对于不支持从OpenCLC源代码编译的设备,此查询可能返回一个空数组。

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.

返回设备支持的以空格分隔的扩展名列表(扩展名本身不包含任何空格)。扩展名列表可能包括Khronos批准的扩展名和供应商指定的扩展名。

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

所有支持OpenCL 1.1的设备都必须返回以下Khronos扩展名:

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 when and only when the optional feature is supported:

此外,当且仅当支持可选功能时,所有支持OpenCL 1.2的设备都必须返回以下Khronos扩展名:

cl_khr_fp64

Additionally, the following Khronos extension names must be returned by all devices that support OpenCL 2.0, OpenCL 2.1, or OpenCL 2.2. For devices that support OpenCL 3.0, these extension names must be returned when and only when the optional feature is supported:

此外,所有支持OpenCL 2.0、OpenCL 2.1或OpenCL 2.2的设备都必须返回以下Khronos扩展名。对于支持OpenCL 3.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.

有关这些扩展的详细描述,请参阅OpenCL扩展规范或供应商提供的文档。

CL_DEVICE_EXTENSIONS_WITH_VERSION

missing before version 3.0.

cl_name_version[]

Returns an array of description (name and version) structures. The same extension name must not be reported more than once. The list of extensions reported must match the list reported via CL_DEVICE_EXTENSIONS.

返回描述(名称和版本)结构的数组。同一扩展名不能报告多次。报告的扩展名列表必须与通过CL_DEVICE_EXTENSIONS报告的列表匹配。

See CL_DEVICE_EXTENSIONS for a list of extensions that are required to be reported for a given OpenCL version.

请参阅CL_DEVICE_EXTENSIONS以获取给定OpenCL版本需要报告的扩展列表。

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.

保存内核printf调用输出的内部缓冲区的最大大小(以字节为单位)。FULL配置文件的最小值为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.

当在OpenCL和诸如DirectX的其他API之间共享内存对象时,如果设备偏好是用户负责同步,则为CL_TRUE;如果设备/实现具有用于执行在OpenCL与诸如DirectX的其它API之间共享的内存对象的同步的性能路径,则为CL _FALSE。

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_id。如果设备是根级设备,则返回NULL值。

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_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_property值的数组:

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 sub-devices), a value of 0 will be returned.

如果无法对设备进行分区(即,不存在将返回至少两个子设备的设备支持的分区方案),则将返回值0。

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_PARTITION_BY_AFFINITY_DOMAIN对设备进行分区所支持的关联域的列表。这是一个位字段,用于描述以下一个或多个值:

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.

如果设备不支持任何亲和域,则将返回值0。

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_DOMAINCL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE, the affinity domain used to perform the partition will be returned. This can be one of the following values:

如果设备是子设备,则返回clCreateSubDevices中指定的属性参数。如果clCreateSubDevices的属性参数为CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN、CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE,则将返回用于执行分区的关联域。这可以是以下值之一:

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.

否则,该实现可以返回0的param_value_size_ret,即不存在与设备相关联的分区类型,或者可以在param_value所指向的存储器中返回0的属性值(其中0用于终止分区属性列表)。

CL_DEVICE_REFERENCE_COUNT [9]

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 (SVM) memory allocation types the device supports. This is a bit-field that describes a combination of the following values:

描述设备支持的各种共享虚拟内存(SVM)内存分配类型。这是一个位字段,用于描述以下值的组合:

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_COARSE_GRAIN_BUFFER-支持使用clSVMAlloc共享粗粒度缓冲区。同步点保证内存一致性,主机必须使用对clEnqueueMapBuffer和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_BUFFER-支持使用clSVMAlloc的细粒度缓冲区共享。在不需要clEnqueueMapBuffer和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_FINE_GRAIN_SYSTEM-支持共享主机的整个虚拟内存,包括使用malloc分配的内存。在同步点保证内存一致性。


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.

CL_DEVICE_SVM_ATOMICS-支持OpenCL 2.0原子操作,在主机和所有支持细粒度SVM分配的OpenCL设备之间提供内存一致性。

The mandated minimum capability for an OpenCL 2.0, 2.1, or 2.2 device is CL_DEVICE_SVM_COARSE_GRAIN_BUFFER.

For other device versions there is no mandated minimum capability.

OpenCL 2.0、2.1或2.2设备的最低强制功能是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.

返回表示OpenCL 2.0细粒度SVM原子类型的首选对齐方式的值(以字节为单位)。此查询可以返回0,这表示首选对齐方式与类型的自然大小对齐。

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.

返回表示OpenCL 2.0原子类型到全局内存的首选对齐方式的值(以字节为单位)。此查询可以返回0,这表示首选对齐方式与类型的自然大小对齐。

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.

返回表示OpenCL 2.0原子类型到本地内存的首选对齐方式的值(以字节为单位)。此查询可以返回0,这表示首选对齐方式与类型的自然大小对齐。

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 if the device supports sub-groups, and must be 0 for devices that do not support sub-groups. Support for sub-groups is required for an OpenCL 2.1 or 2.2 device.

(Refer also to clGetKernelSubGroupInfo.)

对于在设备上运行的任何给定内核实例,设备能够在单个计算单元上执行的工作组中的最大子组数。
如果设备支持子组,最小值为1;对于不支持子组的设备,最小值必须为0。OpenCL 2.1或2.2设备需要支持子组。
(另请参阅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.

This query must return CL_TRUE for devices that support the cl_khr_subgroups extension, and must return CL_FALSE for devices that do not support sub-groups.

如果此设备支持子组的独立前向进程,则为CL_TRUE,否则为CL_FALSE。
对于支持cl_khr_subgroups 扩展的设备,此查询必须返回CL_TRUE,对于不支持子组的设备,必须返回CL_FALSE。

CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES

missing before version 3.0.

cl_device_atomic_capabilities

Describes the various memory orders and scopes that the device supports for atomic memory operations. This is a bit-field that describes a combination of the following values:

描述设备支持原子内存操作的各种内存顺序和作用域。这是一个位字段,用于描述以下值的组合:

CL_DEVICE_ATOMIC_ORDER_RELAXED - Support for the relaxed memory order.

CL_DEVICE_ATOMIC_ORDER_RELAXED-支持宽松的内存顺序。


CL_DEVICE_ATOMIC_ORDER_ACQ_REL - Support for the acquirerelease, and acquire-release memory orders.

CL_DEVICE_ATOMIC_ORDER_ACQ_REL-支持acquirereleaseacquire-release内存顺序。


CL_DEVICE_ATOMIC_ORDER_SEQ_CST - Support for the sequentially consistent memory order.

CL_DEVICE_ATOMIC_ORDER_SEQ_CST-支持顺序一致的内存顺序。

CL_DEVICE_ATOMIC_ORDER_SEQ_CST-支持顺序一致的内存顺序。

Because atomic memory orders are hierarchical, a device that supports a strong memory order must also support all weaker memory orders.

因为原子内存顺序是分层的,所以支持强内存顺序的设备也必须支持所有较弱的内存顺序。

CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM [10] - Support for memory ordering constraints that apply to a single work-item.

CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM[10]-支持应用于单个工作项的内存排序约束。


CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP - Support for memory ordering constraints that apply to all work-items in a work-group.

CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP-支持应用于工作组中所有工作项的内存排序约束。


CL_DEVICE_ATOMIC_SCOPE_DEVICE - Support for memory ordering constraints that apply to all work-items executing on the device.

CL_DEVICE_ATOMIC_SCOPE_DEVICE-支持应用于设备上执行的所有工作项的内存排序约束。


CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES - Support for memory ordering constraints that apply to all work-items executing across all devices that can share SVM memory with each other and the host process.

CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES-支持适用于在所有设备上执行的所有工作项的内存排序约束,这些设备可以相互共享SVM内存,也可以与主机进程共享SVM内存。

Because atomic scopes are hierarchical, a device that supports a wide scope must also support all narrower scopes, except for the work-item scope, which is a special case.

因为原子作用域是分层的,所以支持宽作用域的设备也必须支持所有较窄的作用域,工作项作用域除外,这是一种特殊情况。

The mandated minimum capability is:

规定的最低能力是:

CL_DEVICE_ATOMIC_ORDER_RELAXED |
CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP

CL_DEVICE_ATOMIC_FENCE_CAPABILITIES

missing before version 3.0.

cl_device_atomic_capabilities

Describes the various memory orders and scopes that the device supports for atomic fence operations. This is a bit-field that has the same set of possible values as described for CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES.

描述设备支持原子栅栏操作的各种内存顺序和作用域。这是一个位字段,具有与CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES所述相同的一组可能值。

The mandated minimum capability is:

规定的最低能力是:

CL_DEVICE_ATOMIC_ORDER_RELAXED |
CL_DEVICE_ATOMIC_ORDER_ACQ_REL |
CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP

CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT

missing before version 3.0.

cl_bool

Is CL_TRUE if the device supports non-uniform work-groups, and CL_FALSE otherwise.

如果设备支持非统一工作组,则为CL_TRUE,否则为CL_FALSE。

CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT

missing before version 3.0.

cl_bool

Is CL_TRUE if the device supports work-group collective functions e.g. work_group_broadcastwork_group_reduce, and work_group_scan, and CL_FALSE otherwise.

​如果设备支持工作组集体功能,例如work_group_broadcastwork_group_reducework_group_scan,则为CL_TRUE,否则为CL_FALSE。

CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT

missing before version 3.0.

cl_bool

Is CL_TRUE if the device supports the generic address space and its associated built-in functions, and CL_FALSE otherwise.

如果设备支持通用地址空间及其相关的内置功能,则为CL_TRUE,否则为CL_FALSE。

CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES

missing before version 3.0.

cl_device_device_enqueue_capabilities

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

描述设备的设备端入队功能。这是一个位字段,用于描述以下一个或多个值:

CL_DEVICE_QUEUE_SUPPORTED - Device supports device-side enqueue and on-device queues.

CL_DEVICE_QUEUE_SUPPORTED-设备支持设备端排队和设备上排队。


CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT - Device supports a replaceable default on-device queue.

CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT-设备支持设备队列上的可替换默认值。

If CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT is set, CL_DEVICE_QUEUE_SUPPORTED must also be set.

如果已设置CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT,则还必须设置CL_DEVICE_QUEUE_SUPPORTED。

Devices that set CL_DEVICE_QUEUE_SUPPORTED for CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES must also return CL_TRUE for CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT.

为CL_DEVICE_DEVICE_QUEUE_CAPABILITIES设置CL_DEVICE_QUEUE_SUPPORTED的设备还必须为CL_DEVICE_GENERIC_ADDRES_SPACE_SUPPORT返回CL_TRUE。

CL_DEVICE_PIPE_SUPPORT

missing before version 3.0.

cl_bool

Is CL_TRUE if the device supports pipes, and CL_FALSE otherwise.

如果设备支持管道,则为CL_TRUE,否则为CL_FALSE。

Devices that return CL_TRUE for CL_DEVICE_PIPE_SUPPORT must also return CL_TRUE for CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT.

为CL_DEVICE_PIPE_SUPPORT返回CL_TRUE的设备还必须为CL_DEVICE_GENERIC_ADDRES_SPACE_SUPPORT返回CL _TRUE。

CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE

missing before version 3.0.

size_t

Returns the preferred multiple of work-group size for the given device. This is a performance hint intended as a guide when specifying the local work size argument to clEnqueueNDRangeKernel.

返回给定设备的工作组大小的首选倍数。这是一个性能提示,用于在为clEnqueueNDRangeKernel指定本地工作大小参数时作为指导。

(Refer also to clGetKernelWorkGroupInfo where CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE can return a different value to CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE which may be more optimal.)

(另请参阅clGetKernelWorkGroupInfo,其中CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE可以向CL_DEVICE_PREFERRED_WORK_GROUP返回不同的值,该值可能更为优化。)

CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED

missing before version 3.0.

char[]

Returns the latest version of the conformance test suite that this device has fully passed in accordance with the official conformance process.

返回此设备已根据官方一致性流程完全通过的一致性测试套件的最新版本。

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

如果函数执行成功,clGetDeviceInfo将返回CL_SUCCESS。否则,它将返回以下错误之一:

  • CL_INVALID_DEVICE if device is not a valid device.

  • CL_INVALID_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_INVALID_VALUE如果param_name不是支持的值之一,或者param_value_size 指定的字节大小小于设备查询表中指定的返回类型的大小,并且param_value 不是NULL值,或者param_name是一个可用作扩展的值,而设备不支持相应的扩展。

  • CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

  • CL_OUT_OF_RESOURCES,如果在设备上分配OpenCL实现所需的资源失败。

  • CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

  • CL_OUT_OF_HOST_MEMORY,如果在主机上分配OpenCL实现所需的资源失败。

To query device and host timestamps, call the function:

要查询设备和主机的时间戳,请调用函数:

cl_int clGetDeviceAndHostTimer(
    cl_device_id device,
    cl_ulong* device_timestamp,
    cl_ulong* host_timestamp);

clGetDeviceAndHostTimer is missing before version 2.1.

版本2.1之前缺少clGetDeviceAndHostTimer。

  • device is a device returned by clGetDeviceIDs.

  • ​device是clGetDeviceID返回的设备。

  • device_timestamp will be updated with the value of the device timer in nanoseconds. The resolution of the timer is the same as the device profiling timer returned by clGetDeviceInfo and the CL_DEVICE_PROFILING_TIMER_RESOLUTION query.

  • ​device_timestamp将使用以纳秒为单位的设备计时器的值进行更新。计时器的分辨率与clGetDeviceInfo和CL_DEVICE_PROFILING_TIMER_RESOLUTION查询返回的设备配置计时器相同。

  • host_timestamp will be updated with the value of the host timer in nanoseconds at the closest possible point in time to that at which device_timer was returned. The resolution of the timer may be queried via clGetPlatformInfo and the flag CL_PLATFORM_HOST_TIMER_RESOLUTION.

  • ​host_timestamp将在最接近返回device_timer的时间点使用主机计时器的值(以纳秒为单位)进行更新。定时器的分辨率可以通过clGetPlatformInfo和标志CL_PLATFORM_HOST_TIMER_RESOLUTION来查询。

clGetDeviceAndHostTimer returns a reasonably synchronized pair of timestamps from the device timer and the host timer as seen by device. Implementations may need to execute this query with a high latency in order to provide reasonable synchronization of the timestamps. The host timestamp and device timestamp returned by this function and clGetHostTimer each have an implementation-defined timebase. The timestamps will always be in their respective timebases regardless of which query function is used. The timestamp returned from clGetEventProfilingInfo for an event on a device and a device timestamp queried from the same device will always be in the same timebase.

clGetDeviceAndHostTimer从设备计时器和主机计时器返回一对合理同步的时间戳,如设备所见。实现可能需要以高延迟执行该查询,以便提供时间戳的合理同步。此函数和clGetHostTimer返回的主机时间戳和设备时间戳各有一个实现定义的时基。无论使用哪种查询函数,时间戳都将始终处于各自的时基中。从设备上事件的clGetEventProfileInfo返回的时间戳和从同一设备查询的设备时间戳将始终位于同一时基中。

clGetDeviceAndHostTimer will return CL_SUCCESS with a time value in host_timestamp if provided. Otherwise, it returns one of the following errors:

clGetDeviceAndHostTimer将返回带有host_timestamp中的时间值的CL_SUCCESS(如果提供)。否则,它将返回以下错误之一:

  • CL_INVALID_DEVICE if device is not a valid device.

  • CL_INVALID_DEVICE(如果设备不是有效设备)。

  • CL_INVALID_OPERATION if the platform associated with device does not support device and host timer synchronization.

  • CL_INVALID_OPERATION(如果与设备相关联的平台不支持设备和主机定时器同步)。

  • CL_INVALID_VALUE if host_timestamp or device_timestamp is NULL.

  • 如果主机时间戳或设备时间戳为NULL,则CL_INVALID_VALUE。

  • CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

  • CL_OUT_OF_RESOURCES,如果在设备上分配OpenCL实现所需的资源失败。

  • CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

  • CL_OUT_OF_HOST_MEMORY,如果在主机上分配OpenCL实现所需的资源失败。

To query the host clock, call the function:

要查询主机时钟,请调用函数:

cl_int clGetHostTimer(
    cl_device_id device,
    cl_ulong* host_timestamp);

clGetHostTimer is missing before version 2.1.

版本2.1之前缺少clGetHostTimer。

  • device is a device returned by clGetDeviceIDs.

  • ​device是clGetDeviceID返回的设备。

  • host_timestamp will be updated with the value of the current timer in nanoseconds. The resolution of the timer may be queried via clGetPlatformInfo and the flag CL_PLATFORM_HOST_TIMER_RESOLUTION.

  • ​host_timestamp将更新为当前计时器的值(以纳秒为单位)。定时器的分辨率可以通过clGetPlatformInfo和标志CL_PLATFORM_HOST_TIMER_RESOLUTION来查询。

clGetHostTimer returns the current value of the host clock as seen by device. This value is in the same timebase as the host_timestamp returned from clGetDeviceAndHostTimer. The implementation will return with as low a latency as possible to allow a correlation with a subsequent application sampled time. The host timestamp and device timestamp returned by this function and clGetDeviceAndHostTimer each have an implementation-defined timebase. The timestamps will always be in their respective timebases regardless of which query function is used. The timestamp returned from clGetEventProfilingInfo for an event on a device and a device timestamp queried from the same device will always be in the same timebase.

clGetHostTimer返回设备看到的主机时钟的当前值。此值与从clGetDeviceAndHostTimer返回的host_timestamp在相同的时基中。该实现将以尽可能低的延迟返回,以允许与后续应用程序采样时间相关。此函数和clGetDeviceAndHostTimer返回的主机时间戳和设备时间戳各有一个实现定义的时基。无论使用哪种查询函数,时间戳都将始终处于各自的时基中。从设备上事件的clGetEventProfileInfo返回的时间戳和从同一设备查询的设备时间戳将始终位于同一时基中。

clGetHostTimer will return CL_SUCCESS with a time value in host_timestamp if provided. Otherwise, it returns one of the following errors:

clGetHostTimer将返回带有host_timestamp中的时间值的CL_SUCCESS(如果提供)。否则,它将返回以下错误之一:

  • CL_INVALID_DEVICE if device is not a valid device.

  • CL_INVALID_DEVICE(如果设备不是有效设备)。

  • CL_INVALID_OPERATION if the platform associated with device does not support device and host timer synchronization.

  • CL_INVALID_OPERATION(如果与设备相关联的平台不支持设备和主机定时器同步)。

  • CL_INVALID_VALUE if host_timestamp is NULL.

  • 如果host_timestamp为NULL,则CL_INVALID_VALUE。

  • CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

  • CL_OUT_OF_RESOURCES,如果在设备上分配OpenCL实现所需的资源失败。

  • CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

  • CL_OUT_OF_HOST_MEMORY,如果在主机上分配OpenCL实现所需的资源失败。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值