logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

clCreateKernel - Creates a kernel object.

Authors

TheKhronosGroup

Errors

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_PROGRAM if program is not a valid program object.

       •   CL_INVALID_PROGRAM_EXECUTABLE if there is no successfully built executable for program.

       •   CL_INVALID_KERNEL_NAME if kernel_name is not found in program.

       •   CL_INVALID_KERNEL_DEFINITION if the function definition for __kernel function 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_VALUE if kernel_name is NULL.

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

Name

       clCreateKernel - Creates a kernel object.

       cl_kernelclCreateKernel(cl_programprogram,constchar*kernel_name,cl_int*errcode_ret);

Notes

        1. OpenCL Specification
           page 157, section 5.7.1 - Creating Kernel Objects

The Khronos Group                                  11/18/2024                               CLCREATEKERNEL(3clc)

Parameters

program
           A program object with a successfully built executable.

        kernel_name
           A function name in the program declared with the __kernel qualifier

        errcode_ret
           Returns an appropriate error code. If errcode_ret is NULL, no error code is returned.

See Also

clCreateKernelsInProgram(3clc), clRetainKernel(3clc), clReleaseKernel(3clc), clSetKernelArg(3clc),
       clGetKernelInfo(3clc), clGetKernelWorkGroupInfo(3clc), classDiagram(3clc)

Specification

OpenCLSpecification[1]

See Also