CLRELEASEMEMOBJECT(3clc)
β¨ CLRELEASEMEMOBJECT β¨
(that's the 3clc page, bestie β straight out of the OpenCL Manual)
okay so picture this: you've got a memory object, right? and it's out here living its best life with a whole reference count. this function is the "okay girl, you can go now" button. it decrements the memory object reference count π
cl_int clReleaseMemObject(cl_mem memobj);
πΈ NAME πΈ
clReleaseMemObject β decrements the memory object reference count.
cl_int clReleaseMemObject(cl_mem memobj);
π NOTES π
okay so here's the tea π« β once the memobj reference count hits zero, AND every command that was queued for execution on the command-queue(s) using memobj has finished... then the memory object gets deleted. it's giving "we don't leave until the last guest is gone" energy β¨
and also!! if memobj is a buffer object, memobj literally cannot be deleted until all the sub-buffer objects associated with memobj are deleted first. no skipping the line, bestie π
π₯ ERRORS π₯
returns CL_SUCCESS if the function is executed successfully. otherwise it hands you back one of these bad boys:
CL_INVALID_MEM_OBJECTβ ifmemobjis a not a valid memory object πCL_OUT_OF_RESOURCESβ if there is a failure to allocate resources required by the OpenCL implementation on the device πCL_OUT_OF_HOST_MEMORYβ if there is a failure to allocate resources required by the OpenCL implementation on the host π
π SPECIFICATION π
OpenCL Specification[1]
π SEE ALSO π
the whole friend group fr fr π«Ά
clCreateBuffer(3clc)clEnqueueCopyBuffer(3clc)clEnqueueReadBuffer(3clc)clEnqueueWriteBuffer(3clc)clRetainMemObject(3clc)
π AUTHORS π
The Khronos Group
π 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.
π«Ά yes the legal bit is verbatim, do NOT come for me, it's a whole license and it ate π
π NOTES π
(the lil footnote one, not the other one β keep up bestie π)
- OpenCL Specification page 118, section 5.4.1 - Retaining and Releasing Memory Objects
and that's the whole page, no cap! πβ¨ brought to you by The Khronos Group, dated 01/14/2021, filed under CLRELEASEMEMOBJECT(3clc) β go release some memory objects, you absolute icon, periodt ππ¦π
π¦ 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