CLCREATEPROGRAMWITHB(3clc)

πŸ“¦
version 1.0~svn33624 Β· 3 versions
, in ubuntu jammy, ubuntu noble

πŸ’– 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 the device_list. Count them, bestie, we're not guessing πŸ”’
  • device_list β€” a pointer to a list of devices that live in context. This one is NOT allowed to be a NULL value, 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 with context β€” 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_CONTEXT if context is not a valid context πŸ™ˆ
  • CL_INVALID_VALUE if device_list is NULL or num_devices is zero πŸ’€
  • CL_INVALID_VALUE if kernel_names is NULL, or kernel_names contains a kernel name that none of the devices in device_list support. Yeah, that one hurts 😭
  • CL_INVALID_DEVICE if the devices listed in device_list are not in the list of devices associated with context β€” caught lacking fr fr
  • CL_OUT_OF_RESOURCES if there's a failure to allocate the resources the OpenCL implementation needs on the device 🫠
  • CL_OUT_OF_HOST_MEMORY if 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 Β© 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 πŸ¦‹

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