'\" t .\" Title: clCreateKernelsInProgram .\" 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 "CLCREATEKERNELSINPRO" "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" clCreateKernelsInProgram \- Creates kernel objects for all kernel functions in a program object\&. .SH "" .HP \w'cl_int\ clCreateKernelsInProgram('u .BI "cl_int clCreateKernelsInProgram(cl_program\ " "program" ", cl_uint\ " "num_kernels" ", cl_kernel\ *" "kernels" ", cl_uint\ *" "num_kernels_ret" ");" .SH "PARAMETERS" .PP \fI program \fR .RS 4 A program object with a successfully built executable\&. .RE .PP \fI num_kernels \fR .RS 4 The size of memory pointed to by \fIkernels\fR specified as the number of \fBcl_kernel\fR entries\&. .RE .PP \fI kernels \fR .RS 4 The buffer where the kernel objects for kernels in \fIprogram\fR will be returned\&. If \fIkernels\fR is NULL, it is ignored\&. If \fIkernels\fR is not NULL, \fInum_kernels\fR must be greater than or equal to the number of kernels in \fIprogram\fR\&. .RE .PP \fI num_kernels_ret \fR .RS 4 The number of kernels in \fIprogram\fR\&. If \fInum_kernels_ret\fR is NULL, it is ignored\&. .RE .SH "NOTES" .PP Creates kernel objects for all kernel functions in \fIprogram\fR\&. Kernel objects are not created for any \fBfunctionQualifiers\fR(3clc) functions in \fIprogram\fR that do not have the same function definition across all devices for which a program executable has been successfully built\&. .PP 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 \fBclBuildProgram\fR(3clc) and \fBclCompileProgram\fR(3clc) return \fBCL_INVALID_OPERATION\fR if there are kernel objects attached to a program object\&. The OpenCL context associated with \fIprogram\fR will be the context associated with \fIkernel\fR\&. The list of devices associated with \fIprogram\fR are the devices associated with kernel\&. 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\&. .SH "ERRORS" .PP Returns CL_SUCCESS if the kernel objects are successfully allocated\&. Otherwise, it returns one of the following errors: .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 any device in \fIprogram\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if \fIkernels\fR is not NULL and \fInum_kernels\fR is less than the number of kernels in \fIprogram\fR\&. .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 \fBclCreateKernel\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 158, section 5.7.1 - Creating Kernel Objects .RE