'\" t .\" Title: clCreateKernel .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 02/03/2019 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "CLCREATEKERNEL" "3clc" "02/03/2019" "The Khronos Group" "OpenCL Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" clCreateKernel \- Creates a kernel object\&. .SH "" .HP \w'cl_kernel\ clCreateKernel('u .BI "cl_kernel clCreateKernel(cl_program\ " "program" ", const\ char\ *" "kernel_name" ", cl_int\ *" "errcode_ret" ");" .SH "PARAMETERS" .PP \fI program \fR .RS 4 A program object with a successfully built executable\&. .RE .PP \fI kernel_name \fR .RS 4 A function name in the program declared with the \fB__kernel\fR qualifier .RE .PP \fI errcode_ret \fR .RS 4 Returns an appropriate error code\&. If \fIerrcode_ret\fR is NULL, no error code is returned\&. .RE .SH "NOTES" .PP A kernel is a function declared in a program\&. A kernel is identified by the \fBfunctionQualifiers\fR(3clc) qualifier applied to any function in a program\&. A kernel object encapsulates the specific \fB__kernel\fR function declared in a program and the argument values to be used when executing this \fB__kernel\fR function\&. .SH "ERRORS" .PP \fBclCreateKernel\fR returns a valid non\-zero kernel object and \fIerrcode_ret\fR 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 \fIerrcode_ret\fR: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_PROGRAM if \fIprogram\fR is not a valid program object\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_PROGRAM_EXECUTABLE if there is no successfully built executable for \fIprogram\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_KERNEL_NAME if \fIkernel_name\fR is not found in \fIprogram\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_KERNEL_DEFINITION if the function definition for \fB__kernel\fR function given by \fIkernel_name\fR such as the number of arguments, the argument types are not the same for all devices for which the \fIprogram\fR executable has been built\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if \fIkernel_name\fR is NULL\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host\&. .RE .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBclCreateKernelsInProgram\fR(3clc), \fBclRetainKernel\fR(3clc), \fBclReleaseKernel\fR(3clc), \fBclSetKernelArg\fR(3clc), \fBclGetKernelInfo\fR(3clc), \fBclGetKernelWorkGroupInfo\fR(3clc), \fBclassDiagram\fR(3clc) .SH "AUTHORS" .PP \fBThe Khronos Group\fR .SH "COPYRIGHT" .br Copyright \(co 2007-2011 The Khronos Group Inc. .br Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials. .sp .SH "NOTES" .IP " 1." 4 OpenCL Specification .RS 4 \%page 157, section 5.7.1 - Creating Kernel Objects .RE