CLRELEASEKERNEL(3clc)
π NAME π
okay so bestie, welcome to the OpenCL Manual, 3clc edition, and today's main character is clReleaseKernel β she decrements the kernel reference count. that's it, that's the job π
cl_int clReleaseKernel(cl_kernel kernel);
that's the whole signature, she's lowkey tiny but highkey important π
π«Ά NOTES π«Ά
so here's the tea: the kernel object gets deleted once the number of instances that are retained to kernel become zero, and the kernel object is no longer needed by any enqueued commands that use kernel.
like. both conditions. she's not leaving the party until everyone who's holding onto her has let go AND the queued commands are done with her. main character exit, fr fr β¨
π ERRORS π
Returns CL_SUCCESS if the kernel objects are successfully alloctaed. (yes, "alloctaed" β that's the manpage's spelling, not mine, we're keeping it, it's iconic in a cursed way π)
Otherwise? it returns one of the following errors, and none of them are cute:
CL_INVALID_KERNELβ ifkernelis not a valid kernel object. not a real kernel, bestie, vibe check failed πCL_OUT_OF_RESOURCESβ if there is a failure to allocate resources required by the OpenCL implementation on the device. the device ran out, she's struggling πCL_OUT_OF_HOST_MEMORYβ if there is a failure to allocate resources required by the OpenCL implementation on the host. and this one is the host running out. double oof, no cap π
π SPECIFICATION π
OpenCL Specification[1] β go read her, she's the blueprint β
π¦ SEE ALSO π¦
the whole friend group, go say hi:
clCreateKernel(3clc)clCreateKernelsInProgram(3clc)clRetainKernel(3clc)clSetKernelArg(3clc)clGetKernelInfo(3clc)clGetKernelWorkGroupInfo(3clc)
π AUTHORS π
The Khronos Group β kings, honestly π
π 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 condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.
πΈ NOTES πΈ
- OpenCL Specification, page 159, section 5.7.1 - Creating Kernel Objects β that's where the lore lives, iykyk πβ¨
and that's the whole page, bestie!! π this was the OpenCL Manual, brought to you by The Khronos Group, dated 01/14/2021, filed under CLRELEASEKERNEL(3clc) β now go release your kernels responsibly, love u, bye ππ¦
π¦ 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