CLRELEASECONTEXT(3clc)

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

πŸ’… 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 β€” if context is 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 Β© 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 πŸ“

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