C Specification

To pass additional information other than argument values to a kernel, call the function

cl_int clSetKernelExecInfo(
    cl_kernel kernel,
    cl_kernel_exec_info param_name,
    size_t param_value_size,
    const void* param_value);

Parameters

  • kernel specifies the kernel object being queried.

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

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

CL_​KERNEL_​EXEC_​INFO_​SVM_​PTRS

Missing before version 2.0.

void *[]

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

CL_​KERNEL_​EXEC_​INFO_​SVM_​FINE_​GRAIN_​SYSTEM

Missing before version 2.0.

cl_bool

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.

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

  • CL_​INVALID_​KERNEL if kernel is a not a valid kernel object.

  • CL_​INVALID_​VALUE if param_name is not valid, if param_value is NULL or if the size specified by param_value_size is not valid.

  • CL_​INVALID_​OPERATION if param_name = CL_​KERNEL_​EXEC_​INFO_​SVM_​FINE_​GRAIN_​SYSTEM and param_value = CL_​TRUE but no devices in context associated with kernel support fine-grain system SVM allocations.

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