Creates kernel objects for all kernel functions in a program object.
cl_int clCreateKernelsInProgram(cl_program program, cl_uint num_kernels, cl_kernel *kernels, cl_uint *num_kernels_ret)
A program object with a successfully built executable.
The size of memory pointed to by
kernelsspecified as the number of
The buffer where the kernel objects for kernels in
programwill be returned. If
kernelsis NULL, it is ignored. If
kernelsis not NULL,
num_kernelsmust be greater than or equal to the number of kernels in
The number of kernels in
num_kernels_retis NULL, it is ignored.
Creates kernel objects for all kernel functions in
Kernel objects are not created for any
__kernel functions in
program that do not have the same function definition across all devices for which a program executable has been successfully built.
Kernel objects can only be created once you have a program object with a valid program source or binary loaded into the program object and the program executable has been successfully built for one or more devices associated with program.
No changes to the program executable are allowed while there are kernel objects associated with a program object.
This means that calls to
CL_INVALID_OPERATION if there are kernel objects attached to a program object.
The OpenCL context associated with
program will be the context associated with
The list of devices associated with
program are the devices associated with
Devices associated with a program object for which a valid program executable has been built can be used to execute kernels declared in the program object.
CL_SUCCESS if the kernel objects are successfully allocated.
Otherwise, it returns one of the following errors:
programis not a valid program object.
CL_INVALID_PROGRAM_EXECUTABLEif there is no successfully built executable for any device in
kernelsis not NULL and
num_kernelsis less than the number of kernels in
CL_OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.