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);
clSetKernelExecInfo is missing before version 2.0.


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


Table 1. List of supported param_names by clSetKernelExecInfo
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.

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.


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.

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_OPERATION if no devices in the context associated with kernel support SVM.

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

  • 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 2014-2023 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0