CLRELEASECONTEXT(3clc)
π CLRELEASECONTEXT π
okay bestie, welcome to the OpenCL Manual β today we're doing clReleaseContext, and honestly? it's giving "let it go" but make it refcounting. π¦
β¨ NAME β¨
clReleaseContext β decrement the context reference count. that's it. that's the whole job. she's simple, she's iconic, she's literally one line of C:
cl_int clReleaseContext(cl_context context);
π PARAMETERS π
contextβ the context you're releasing. say bye to her. π«Ά
πΈ NOTES πΈ
okay so here's the tea β β once the context reference count hits zero, and all the objects attached to context (think memory objects, command-queues, all her little friends) are released, the context is deleted. no cap, that's when she actually dips. β¨
π ERRORS π
returns CL_SUCCESS if the function executed successfully. otherwise it hands you one of these bad boys:
CL_INVALID_CONTEXTβ ifcontextis not a valid OpenCL context. πCL_OUT_OF_RESOURCESβ if there's a failure to allocate resources required by the OpenCL implementation on the device.CL_OUT_OF_HOST_MEMORYβ if there's a failure to allocate resources required by the OpenCL implementation on the host.
π SPECIFICATION π
OpenCL Specification[1] β
π SEE ALSO π
clCreateContext(3clc), clCreateContextFromType(3clc), clGetContextInfo(3clc), clRetainContext(3clc), clGetContextInfo(3clc) β yes, clGetContextInfo is listed twice, and honestly? main character energy. iykyk. π
π§ 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.
π NOTES π
- OpenCL Specification β page 57, section 4.4 - Contexts π
and that's the whole page, bestie π go forth and release your contexts responsibly. remember: refcount to zero, then she's gone. periodt. β¨
the Khronos Group wrote this one, dated 01/14/2021, and it lives under the name CLRELEASECONTEXT(3clc). slay. ππ¦π
π¦ 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