5.9.2. Setting Kernel Arguments
5.9.2. 设置内核参数
To execute a kernel, the kernel arguments must be set.
要执行内核,必须设置内核参数。
To set the argument value for a specific argument of a kernel, call the function
要为内核的特定参数设置参数值,请调用以下函数
// Provided by CL_VERSION_1_0
cl_int clSetKernelArg(
cl_kernel kernel,
cl_uint arg_index,
size_t arg_size,
const void* arg_value);
-
kernel is a valid kernel object.
-
kernel是一个有效的内核对象。
-
arg_index is the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument to n - 1, where n is the total number of arguments declared by a kernel (see below).
-
arg_index是参数索引。指向内核的参数由从最左侧参数的0到n-1的索引引用,其中n是内核声明的参数总数(见下文)。
-
arg_size specifies the size of the argument value. If the argument is a memory object, the arg_size value must be equal to
sizeof(. For arguments declared with thecl_mem)localqualifier, the size specified will be the size in bytes of the buffer that must be allocated for thelocalargument. If the argument is of type sampler_t, the arg_size value must be equal tosizeof(. If the argument is of type queue_t, the arg_size value must be equal tocl_sampler)sizeof(. For all other arguments, the size will be the size of argument type.cl_command_queue) -
arg_size指定参数值的大小。如果参数是内存对象,则arg_size值必须等于sizeof(cl_mem)。对于使用本地限定符声明的参数,指定的大小将是必须为本地参数分配的缓冲区的字节大小。如果参数的类型为sampler_t,则arg_size值必须等于sizeof(cl_sampler)。如果参数的类型为queue_t,则arg_size值必须等于sizeof(cl_command_queue)。对于所有其他参数,大小将是参数类型的大小。
-
arg_value is a pointer to data that should be used as the argument value for argument specified by arg_index. The argument data pointed to by arg_value is copied and the arg_value pointer can therefore be reused by the application after clSetKernelArg returns. The argument value specified is the value used by all API calls that enqueue kernel (clEnqueueNDRangeKernel and clEnqueueTask) until the argument value is changed by a call to clSetKernelArg for kernel.
-
arg_value是指向数据的指针,该数据应用作arg_index指定的参数的参数值。arg_value指向的参数数据被复制,因此在clSetKernelArg返回后,arg_value指针可以被应用程序重用。指定的参数值是使内核入队的所有API调用(clEnqueueNDRangeKernel和clEnqueueTask)使用的值,直到内核的clSetKernelArg调用更改了参数值为止。
For example, consider the following kernel:
例如,考虑以下内核:
kernel void image_filter (int n,
int m,
constant float *filter_weights,
read_only image2d_t src_image,
write_only image2d_t dst_image)
{
...
}
Argument index values for image_filter will be 0 for n, 1 for m, 2 for filter_weights, 3 for src_image and 4 for dst_image.
image_filter的参数索引值对于n将为0,对于m将为1,对于filter_weights将为2,对于src_image将为3,对于dst_image为4。
If the argument is a memory object (buffer, pipe, image or image array), the arg_value entry will be a pointer to the appropriate buffer, pipe, image or image array object. The memory object must be created with the context associated with the kernel object. If the argument is a buffer object, the arg_value pointer can be NULL or point to a NULL value in which case a NULL value will be used as the value for the argument declared as a pointer to global or constant memory in the kernel. If the argument is declared with the local qualifier, the arg_value entry must be NULL. If the argument is of type sampler_t, the arg_value entry must be a pointer to the sampler object. If the argument is of type queue_t, the arg_value entry must be a pointer to the device queue object.
如果参数是内存对象(缓冲区、管道、图像或图像数组),则arg_value条目将是指向相应缓冲区、管道、图像或图片数组对象的指针。必须使用与内核对象关联的上下文创建内存对象。如果参数是缓冲区对象,则arg_value指针可以为NULL或指向NULL值,在这种情况下,NULL值将用作声明为指向内核中global或constant内存的指针的参数的值。如果使用local限定符声明参数,则arg_value条目必须为NULL。如果参数的类型为sampler_t,则arg_value条目必须是指向采样器对象的指针。如果参数的类型为queue_t,则arg_value条目必须是指向设备队列对象的指针。
If the cl_khr_gl_msaa_sharing extension is supported, then: If the argument is a multi-sample 2D image, the arg_value entry must be a pointer to a multi-sample image object. If the argument is a multi-sample 2D depth image, the arg_value entry must be a pointer to a multisample depth image object. If the argument is a multi-sample 2D image array, the arg_value entry must be a pointer to a multi-sample image array object. If the argument is a multi-sample 2D depth image array, the arg_value entry must be a pointer to a multi-sample depth image array object.
如果支持cl_khr_gl_msaa_sharing扩展,则:如果参数是多样本2D图像,则arg_value条目必须是指向多样本图像对象的指针。如果参数是多采样2D深度图像,则arg_value条目必须是指向多采样深度图像对象的指针。如果参数是多样本二维图像数组,则arg_value条目必须是指向多样本图像数组对象的指针。如果参数是多样本2D深度图像数组,则arg_value条目必须是指向多样本深度图像数组对象的指针。
If the argument is declared to be a pointer of a built-in scalar or vector type, or a user defined structure type in the global or constant address space, the memory object specified as argument value must be a buffer object (or NULL). If the argument is declared with the constant qualifier, the size in bytes of the memory object cannot exceed CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE and the number of arguments declared as pointers to constant memory cannot exceed CL_DEVICE_MAX_CONSTANT_ARGS.
如果参数被声明为内置标量或向量类型的指针,或者全局或常量地址空间中的用户定义结构类型,则指定为参数值的内存对象必须是缓冲区对象(或NULL)。如果参数是用constant限定符声明的,则内存对象的大小(以字节为单位)不能超过CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE,并且声明为指向CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE内存的指针的参数数量不能超过CL_DEVICE_MAX_CONSTANT_ARGS。
The memory object specified as argument value must be a pipe object if the argument is declared with the pipe qualifier.
如果参数是用pipe限定符声明的,则指定为参数值的内存对象必须是管道对象。
The memory object specified as argument value must be a 2D image object if the argument is declared to be of type image2d_t. The memory object specified as argument value must be a 2D image object with image channel order = CL_DEPTH if the argument is declared to be of type image2d_depth_t. The memory object specified as argument value must be a 3D image object if argument is declared to be of type image3d_t. The memory object specified as argument value must be a 1D image object if the argument is declared to be of type image1d_t. The memory object specified as argument value must be a 1D image buffer object if the argument is declared to be of type image1d_buffer_t. The memory object specified as argument value must be a 1D image array object if argument is declared to be of type image1d_array_t. The memory object specified as argument value must be a 2D image array object if argument is declared to be of type image2d_array_t. The memory object specified as argument value must be a 2D image array object with image channel order = CL_DEPTH if argument is declared to be of type image2d_array_depth_t.
如果参数声明为image2d_t类型,则指定为参数值的内存对象必须是2D图像对象。如果参数声明为image2d_depth_t类型,则指定为参数值的内存对象必须是图像通道顺序为CL_DEPTH的2D图像对象。如果参数声明为image3d_t类型,则指定为参数值的内存对象必须是3D图像对象。如果参数声明为image1d_t类型,则指定为参数值的内存对象必须是1D图像对象。如果参数声明为image1d_buffer_t类型,则指定为参数值的内存对象必须是1D图像缓冲区对象。如果参数声明为image1d_array_t类型,则指定为参数值的内存对象必须是1D图像数组对象。如果参数声明为image2d_array_t类型,则指定为参数值的内存对象必须是二维图像数组对象。如果参数声明为image2d_array_depth_t类型,则指定为参数值的内存对象必须是图像通道顺序为CL_DEPTH的2D图像数组对象。
For all other kernel arguments, the arg_value entry must be a pointer to the actual data to be used as argument value.
对于所有其他内核参数,arg_value条目必须是指向用作参数值的实际数据的指针。
| A kernel object does not update the reference count for objects such as memory or sampler objects specified as argument values by clSetKernelArg. Users may not rely on a kernel object to retain objects specified as argument values to the kernel. 内核对象不会更新clSetKernelArg指定为参数值的内存或采样器对象等对象的引用计数。用户可能不依赖于内核对象来保留指定为内核参数值的对象。 Implementations shall not allow 实现不应允许cl_kernel对象保存对cl_kernel参数的引用计数,因为没有为用户提供任何机制来告诉内核释放该所有权。如果内核对内核参数拥有所有权,那么用户将无法确定何时可以安全地释放与OpenCL对象相关的用户分配的资源,例如与CL_MEM_USE_HOST_PTR一起使用的cl_mem后备存储。 |
clSetKernelArg returns CL_SUCCESS if the function was executed successfully. Otherwise, it returns one of the following errors:
如果函数执行成功,clSetKernelArg将返回CL_SUCCESS。否则,它将返回以下错误之一:
-
CL_INVALID_KERNEL if kernel is not a valid kernel object.
-
CL_INVALID_KERNEL,如果kernel不是有效的内核对象。
-
CL_INVALID_ARG_INDEX if arg_index is not a valid argument index.
-
如果arg_index不是有效的参数索引,则返回CL_INVALID_ARG_INDEX。
-
CL_INVALID_ARG_VALUE if arg_value specified is not a valid value.
-
如果指定的arg_value不是有效值,则返回CL_INVALID_ARG_VALUE。
-
CL_INVALID_MEM_OBJECT for an argument declared to be a memory object when the specified arg_value is not a valid memory object.
-
当指定的arg_value不是有效的内存对象时,声明为内存对象的参数的CL_INVALID_MEM_OBJECT。
-
CL_INVALID_MEM_OBJECT for an argument declared to be a depth image, depth image array, multi-sample image, multi-sample image array, multi-sample depth image, or a multi-sample depth image array when the specified arg_value does not follow the rules described above for a depth memory object or memory array object argument.
-
当指定的arg_value不符合上述深度存储对象或存储阵列对象参数的规则时,CL_INVALID_MEM_OBJECT用于声明为深度图像、深度图像阵列、多样本图像、多样本深度图像阵列或多样本深度图片阵列的参数。
-
CL_INVALID_SAMPLER for an argument declared to be of type sampler_t when the specified arg_value is not a valid sampler object.
-
当指定的arg_value不是有效的采样器对象时,声明为sampler_t类型的参数的CL_INVALID_SAMPLER。
-
CL_INVALID_DEVICE_QUEUE for an argument declared to be of type queue_t when the specified arg_value is not a valid device queue object. This error code is missing before version 2.0.
-
当指定的arg_value不是有效的设备队列对象时,声明为queue_t类型的参数的CL_INVALID_GUEUE。2.0版本之前缺少此错误代码。
-
CL_INVALID_ARG_SIZE if arg_size does not match the size of the data type for an argument that is not a memory object or if the argument is a memory object and arg_size !=
sizeof(or if arg_size is zero and the argument is declared with the local qualifier or if the argument is a sampler and arg_size !=cl_mem)sizeof(.cl_sampler) -
CL_INVALID_ARG_SIZE,如果arg_size与非内存对象的参数的数据类型大小不匹配,或者如果参数是内存对象并且arg_size!=sizeof(cl_mem),或者如果arg_size为零并且参数是用局部限定符声明的,或者如果参数是采样器并且arg_size!=sizeof(cl_sampler)。
-
CL_MAX_SIZE_RESTRICTION_EXCEEDED if the size in bytes of the memory object (if the argument is a memory object) or arg_size (if the argument is declared with
localqualifier) exceeds a language- specified maximum size restriction for this argument, such as the MaxByteOffset SPIR-V decoration. This error code is missing before version 2.2. -
如果内存对象的大小(如果参数是内存对象)或arg_size(如果参数用
local限定符声明)超过了语言为此参数指定的最大大小限制,例如MaxByteOffset SPIR-V修饰,则CL_MAX_SIZE_RESTRICTION_EXCEEDED。2.2版本之前缺少此错误代码。 -
CL_INVALID_ARG_VALUE if the argument is an image declared with the
read_onlyqualifier and arg_value refers to an image object created with cl_mem_flags of CL_MEM_WRITE_ONLY or if the image argument is declared with thewrite_onlyqualifier and arg_value refers to an image object created with cl_mem_flags of CL_MEM_READ_ONLY. -
CL_INVALID_ARG_VALUE,如果参数是用
read_only限定符声明的图像,并且arg_value是指用CL_MEM_WRITE_ONLY的cl_mem_flags创建的图像对象,或者如果图像参数是用写write_only限定符宣布的,并且arg_value是指使用CL_MEM_READ_ONLY的cl_mem_flags生成的图像对象。 -
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实现所需的资源。
When clSetKernelArg returns an error code different from CL_SUCCESS, the internal state of kernel may only be modified when that error code is CL_OUT_OF_RESOURCES or CL_OUT_OF_HOST_MEMORY. When the internal state of kernel is modified, it is implementation-defined whether:
当clSetKernelArg返回与CL_SUCCESS不同的错误代码时,只有当该错误代码为CL_OUT_OF_RESOURCES或CL_OUT_OF_HOST_MEMORY时,才能修改kernel的内部状态。当kernel的内部状态被修改时,实现定义了是否:
-
The argument value that was previously set is kept so that it can be used in further kernel enqueues.
-
保留之前设置的参数值,以便在后续的内核排队中使用。
-
The argument value is unset such that a subsequent kernel enqueue fails with CL_INVALID_KERNEL_ARGS. [27]
-
参数值未设置,因此后续内核入队失败,返回CL_INVALID_KERNEL_ARGS。 [27]
To set a SVM pointer as the argument value for a specific argument of a kernel, call the function
要将SVM指针设置为内核特定参数的参数值,请调用函数
// Provided by CL_VERSION_2_0
cl_int clSetKernelArgSVMPointer(
cl_kernel kernel,
cl_uint arg_index,
const void* arg_value);
| clSetKernelArgSVMPointer is missing before version 2.0. clSetKernelArgSVMPointer在2.0版本之前缺失。 |
-
kernel is a valid kernel object.
-
kernel是一个有效的内核对象。
-
arg_index is the argument index. Arguments to the kernel are referred by indices that go from 0 for the leftmost argument to n - 1, where n is the total number of arguments declared by a kernel.
-
arg_index是参数索引。指向内核的参数由从最左侧参数的0到n-1的索引引用,其中n是内核声明的参数总数。
-
arg_value is the SVM pointer that should be used as the argument value for argument specified by arg_index. The SVM pointer specified is the value used by all API calls that enqueue kernel (clEnqueueNDRangeKernel and clEnqueueTask) until the argument value is changed by a call to clSetKernelArgSVMPointer for kernel. The SVM pointer can only be used for arguments that are declared to be a pointer to
globalorconstantmemory. The SVM pointer value must be aligned according to the arguments type. For example, if the argument is declared to beglobal float4 *p, the SVM pointer value passed forpmust be at a minimum aligned to afloat4. The SVM pointer value specified as the argument value can be the pointer returned by clSVMAlloc or can be a pointer offset into the SVM region. -
arg_value是SVM指针,应该用作arg_index指定的参数的参数值。指定的SVM指针是入队内核的所有API调用(clEnqueueNDRangeKernel和clEnqueueTask)使用的值,直到kernel的clSetKernelArgSVMPointer调用更改参数值为止。SVM指针只能用于声明为指向
global或constant内存的指针的参数。SVM指针值必须根据参数类型进行对齐。例如,如果参数被声明为global float4 *p,则为p传递的SVM指针值必须与float4对齐。指定为参数值的SVM指针值可以是clSVMAlloc返回的指针,也可以是SVM区域的指针偏移量。
clSetKernelArgSVMPointer returns CL_SUCCESS if the function was executed successfully. Otherwise, it returns one of the following errors:
如果函数执行成功,clSetKernelArgSVMPointer将返回CL_SUCCESS。否则,它将返回以下错误之一:
-
CL_INVALID_KERNEL if kernel is not a valid kernel object.
-
CL_INVALID_KERNEL,如果kernel不是有效的内核对象。
-
CL_INVALID_OPERATION if no devices in the context associated with kernel support SVM.
-
如果与kernel关联的上下文中没有设备支持SVM,则为CL_INVALID_OPERATION。
-
CL_INVALID_ARG_INDEX if arg_index is not a valid argument index.
-
如果arg_index不是有效的参数索引,则返回CL_INVALID_ARG_INDEX。
-
CL_INVALID_ARG_VALUE if arg_value specified is not a valid value.
-
如果指定的arg_value不是有效值,则返回CL_INVALID_ARG_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 pass additional information other than argument values to a kernel, call the function
要将参数值以外的其他信息传递给内核,请调用函数
// Provided by CL_VERSION_2_0
cl_int clSetKernelExecInfo(
cl_kernel kernel,
cl_kernel_exec_info param_name,
size_t param_value_size,
const void* param_value);
| clSetKernelExecInfo is missing before version 2.0. clSetKernelExecInfo在2.0版本之前缺失。 |
-
kernel specifies the kernel object being queried.
-
kernel指定要查询的内核对象。
-
param_name specifies the information to be passed to kernel. The list of supported param_name types and the corresponding values passed in param_value is described in the Kernel Execution Properties table.
-
param_name指定要传递给内核的信息。内核执行属性表中描述了支持的param_name类型列表以及在param_value中传递的相应值。
-
param_value_size specifies the size in bytes of the memory pointed to by param_value.
-
param_value_size指定param_value指向的内存的大小(以字节为单位)。
-
param_value is a pointer to memory where the appropriate values determined by param_name are specified.
-
param_value是一个指向内存的指针,在内存中指定了由param_name确定的适当值。
| Kernel Exec Info | Type | Description |
|---|---|---|
| missing before version 2.0. |
| SVM pointers must reference locations contained entirely within buffers that are passed to kernel as arguments, or that are passed through the execution information. SVM指针必须引用完全包含在缓冲区中的位置,这些位置作为参数传递给内核,或者通过执行信息传递。 Non-argument SVM buffers must be specified by passing pointers to those buffers via clSetKernelExecInfo for coarse-grain and fine-grain buffer SVM allocations but not for finegrain system SVM allocations. 对于粗粒度和细粒度缓冲区SVM分配,必须通过clSetKernelExecInfo传递指向这些缓冲区的指针来指定非参数SVM缓冲区,但对于细粒度系统SVM分配则不能。 |
| CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM missing before version 2.0. |
| This flag indicates whether the kernel uses pointers that are fine grain system SVM allocations. These fine grain system SVM pointers may be passed as arguments or defined in SVM buffers that are passed as arguments to kernel. 此标志指示内核是否使用细粒度系统SVM分配的指针。这些细粒度系统SVM指针可以作为参数传递,也可以在作为参数传递给内核的SVM缓冲区中定义。 |
clSetKernelExecInfo returns CL_SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
如果函数执行成功,clSetKernelExecInfo将返回CL_SUCCESS。否则,它将返回以下错误之一:
-
CL_INVALID_KERNEL if kernel is a not a valid kernel object.
-
CL_INVALID_KERNEL,如果kernel不是有效的内核对象。
-
CL_INVALID_OPERATION if no devices in the context associated with kernel support SVM.
-
如果与kernel 关联的上下文中没有设备支持SVM,则为CL_INVALID_OPERATION。
-
CL_INVALID_VALUE if param_name is not valid, if param_value is
NULLor if the size specified by param_value_size is not valid. -
如果param_name无效、param_value为NULL或param_value_size指定的大小无效,则返回CL_INVALID_VALUE。
-
CL_INVALID_OPERATION if param_name is CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM and param_value is CL_TRUE but no devices in context associated with kernel support fine-grain system SVM allocations.
-
如果param_name为CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM,param_value为CL_TRUE,但与kernel关联的上下文中没有设备支持细粒度系统SVM分配,则为CL_INVALID_OPERATION。
-
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实现所需的资源。
| Coarse-grain or fine-grain buffer SVM pointers used by a kernel which are not passed as a kernel arguments must be specified using clSetKernelExecInfo with CL_KERNEL_EXEC_INFO_SVM_PTRS. For example, if SVM buffer A contains a pointer to another SVM buffer B, and the kernel dereferences that pointer, then a pointer to B must either be passed as an argument in the call to that kernel or it must be made available to the kernel using clSetKernelExecInfo. For example, we might pass extra SVM pointers as follows: Here 这里num_ptrs指定了额外SVM指针的数量,而 When calling clSetKernelExecInfo with CL_KERNEL_EXEC_INFO_SVM_PTRS to specify pointers to non-argument SVM buffers as extra arguments to a kernel, each of these pointers can be the SVM pointer returned by clSVMAlloc or can be a pointer + offset into the SVM region. It is sufficient to provide one pointer for each SVM buffer used. 当使用CL_KERNEL_EXEC_INFO_SVM_PTRS调用clSetKernelExecInfo以指定指向非参数SVM缓冲区的指针作为内核的额外参数时,这些指针中的每一个都可以是clSVMAlloc返回的SVM指针,也可以是指向SVM区域的指针+偏移量。为每个使用的SVM缓冲区提供一个指针就足够了。 CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM is used to indicate whether SVM pointers used by a kernel will refer to system allocations or not. CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM用于指示内核使用的SVM指针是否将引用系统分配。 CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM = CL_FALSE indicates that the OpenCL implementation may assume that system pointers are not passed as kernel arguments and are not stored inside SVM allocations passed as kernel arguments. CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM=CL_FALSE表示OpenCL实现可能假设系统指针不作为内核参数传递,也不存储在作为内核参数传入的SVM分配中。 CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM = CL_TRUE indicates that the OpenCL implementation must assume that system pointers might be passed as kernel arguments and/or stored inside SVM allocations passed as kernel arguments. In this case, if the device to which the kernel is enqueued does not support system SVM pointers, clEnqueueNDRangeKernel and clEnqueueTask will return a CL_INVALID_OPERATION error. If none of the devices in the context associated with kernel support fine-grain system SVM allocations, clSetKernelExecInfo will return a CL_INVALID_OPERATION error. CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM=CL_TRUE表示OpenCL实现必须假设系统指针可以作为内核参数传递或存储在作为内核参数传入的SVM分配中。在这种情况下,如果内核排队的设备不支持系统SVM指针,clEnqueueNDRangeKernel和clEnqueueTask将返回CL_INVALID_OPERATION错误。如果与内核关联的上下文中没有设备支持细粒度系统SVM分配,clSetKernelExecInfo将返回CL_INVALID_OPERATION错误。 If clSetKernelExecInfo has not been called with a value for CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM, the default value is used for this kernel attribute. The default value depends on whether the device on which the kernel is enqueued supports fine-grain system SVM allocations. If so, the default value used is CL_TRUE (system pointers might be passed); otherwise, the default is CL_FALSE. 如果未使用CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM的值调用clSetKernelExecInfo,则此内核属性将使用默认值。默认值取决于内核排队的设备是否支持细粒度系统SVM分配。如果是这样,则使用的默认值是CL_TRUE(可能会传递系统指针);否则,默认值为CL_FALSE。 A call to clSetKernelExecInfo for a given value of param_name replaces any prior value passed for that value of param_name. Only one param_value will be stored for each value of param_name. 对于给定的param_name值调用clSetKernelExecInfo会替换之前为该param_name值传递的任何值。每个param_name值只存储一个param_value。 |
2689




被折叠的 条评论
为什么被折叠?



