CLCREATEPROGRAMWITHB(3clc)
π NAME π
clCreateProgramWithBuiltInKernels β bestie, this one makes a program object for a context and yeets all the built-in-kernel info into it. It's giving "let me set you up with the hardware's own special sauce kernels" β¨
cl_program clCreateProgramWithBuiltInKernels(cl_context context,
cl_uint num_devices,
const cl_device_id *device_list,
const char *kernel_names,
cl_int *errcode_ret);
πΈ PARAMETERS πΈ
contextβ gotta be a valid OpenCL context, no fakes allowed πnum_devicesβ how many devices are in thedevice_list. Count them, bestie, we're not guessing π’device_listβ a pointer to a list of devices that live incontext. This one is NOT allowed to be aNULLvalue, periodt. The built-in kernels get loaded for exactly the devices in this list. The devices tied to your program object will be the list you pass here, and every single one of them must be a device associated withcontextβ no random devices sneaking in from other contexts, we see you πkernel_namesβ a semi-colon separated list of built-in kernel names. Like a lil playlist but for kernels π
π₯ ERRORS π₯
If everything goes slay, you get a valid non-zero program object back and errcode_ret gets set to CL_SUCCESS. Otherwise it's a NULL return and errcode_ret carries one of these lil gremlins:
CL_INVALID_CONTEXTifcontextis not a valid context πCL_INVALID_VALUEifdevice_listisNULLornum_devicesis zero πCL_INVALID_VALUEifkernel_namesisNULL, orkernel_namescontains a kernel name that none of the devices indevice_listsupport. Yeah, that one hurts πCL_INVALID_DEVICEif the devices listed indevice_listare not in the list of devices associated withcontextβ caught lacking fr frCL_OUT_OF_RESOURCESif there's a failure to allocate the resources the OpenCL implementation needs on the device π«CL_OUT_OF_HOST_MEMORYif there's a failure to allocate the resources the OpenCL implementation needs on the host π«
π SPECIFICATION π
OpenCL Specification[1] β the source of truth, the blueprint, the moment β¨
π SEE ALSO π
clCreateProgramWithSource(3clc), clReleaseProgram(3clc), clRetainProgram(3clc), classDiagram(3clc)
π AUTHORS π
The Khronos Group β icons only π
π COPYRIGHT π
Copyright Β© 2007-2011 The Khronos Group Inc.
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 following condition: the above copyright notice and this permission notice shall be included in all copies or substantial portions of the Materials. That's the deal, no cap π«Ά
π¦ NOTES π¦
- OpenCL Specification β page 135, section 5.6.1 - Creating Program Objects
okay that's the whole page bestie, you ate π
this was CLCREATEPROGRAMWITHB(3clc) from the OpenCL Manual, brought to you by The Khronos Group, dated 01/14/2021. stan the man page, mwah π
π¦ where this page comes from
- ubuntu jammy: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- ubuntu noble: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms