C Specification
To set additional execution information for 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. |
Parameters
-
kernel is a valid kernel object.
-
param_name specifies the type of information to set. The list of supported param_name types and the corresponding values passed in param_value is described in the Kernel Execution Properties table.
-
param_value_size specifies the size in bytes of the memory pointed to by param_value.
-
param_value is a pointer to memory where the appropriate values determined by param_name are specified.
Description
| Kernel Exec Info | Type | Description |
|---|---|---|
missing before version 2.0. |
|
Specifies a set of pointers to SVM allocations that may be accessed by the kernel in addition to those set directly as kernel arguments. Each of the pointers can be the pointer returned by clSVMAlloc or can be a pointer to the middle of an SVM allocation. It is sufficient to specify one pointer for each SVM allocation. Behavior is undefined if the kernel accesses a coarse-grain or
fine-grain buffer SVM allocation that is not set as a kernel argument
and is not in the set specified by The complete set of pointers is specified by each call to
clSetKernelExecInfo and replaces any previously specified set of
pointers.
To specify that no SVM allocations will be accessed by a kernel other
than those set as kernel arguments, specify an empty set by passing
param_value_size equal to zero and param_value equal to Non-argument pointers to SVM allocations must be specified for coarse-grain and fine-grain buffer SVM allocations, but not for fine-grain system SVM allocations. |
missing before version 2.0. |
|
Specifies whether the kernel may use pointers to system allocations that are not set directly as kernel arguments on devices that support fine-grain system SVM allocations. When a device supports fine-grain system SVM allocations and
Otherwise, if a device does not support fine-grain system SVM
allocations or when If clSetKernelExecInfo has not been called with a value for
|
provided by the |
|
Device pointers must reference locations contained entirely within buffers that are passed to kernel as arguments, or that are passed through the execution information. Non-argument device pointers accessed by the kernel must be specified by passing pointers to those buffers via this clSetKernelExecInfo option. |
clSetKernelExecInfo returns CL_SUCCESS if the function is executed
successfully.
Otherwise, it returns one of the following errors:
-
CL_INVALID_if kernel is a not a valid kernel object.KERNEL -
CL_INVALID_forOPERATION CL_KERNEL_andEXEC_ INFO_ SVM_ PTRS CL_KERNEL_if no devices in the context associated with kernel support SVM.EXEC_ INFO_ SVM_ FINE_ GRAIN_ SYSTEM -
CL_INVALID_forOPERATION CL_KERNEL_if no device in the context associated with kernel support theEXEC_ INFO_ DEVICE_ PTRS_ EXT cl_ext_extension.buffer_ device_ address -
CL_INVALID_if param_name is not valid, if param_value isVALUE NULLor if the size specified by param_value_size is not valid. -
CL_INVALID_if param_name isOPERATION CL_KERNEL_and param_value isEXEC_ INFO_ SVM_ FINE_ GRAIN_ SYSTEM CL_TRUEand no devices in the context associated with kernel support fine-grain system SVM allocations. -
CL_INVALID_if param_name is not valid, if param_value isVALUE NULLand param_value_size is greater than zero, or if the size specified by param_value_size is not valid. -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the device.OF_ RESOURCES -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the host.OF_ HOST_ MEMORY
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.