C Specification
To create a kernel object, use the function
// Provided by CL_VERSION_1_0
cl_kernel clCreateKernel(
cl_program program,
const char* kernel_name,
cl_int* errcode_ret);
Parameters
-
program is a program object with a successfully built executable.
-
kernel_name is a function name in the program declared with the
__kernelqualifier. -
errcode_ret will return an appropriate error code. If errcode_ret is
NULL, no error code is returned.
Description
clCreateKernel returns a valid non-zero kernel object and errcode_ret is
set to CL_SUCCESS if the kernel object is created successfully.
Otherwise, it returns a NULL value with one of the following error values
returned in errcode_ret:
-
CL_INVALID_if program is not a valid program object.PROGRAM -
CL_INVALID_if there is no successfully built executable for program.PROGRAM_ EXECUTABLE -
CL_INVALID_if kernel_name is not found in program.KERNEL_ NAME -
CL_INVALID_if the function definition forKERNEL_ DEFINITION __kernelfunction given by kernel_name such as the number of arguments, the argument types are not the same for all devices for which the program executable has been built. -
CL_INVALID_if kernel_name isVALUE NULL. -
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.