memory_object::~memory_object() { if (!m_valid.exchange(false)) return; pyopencl_call_guarded_cleanup(clReleaseMemObject, PYOPENCL_CL_CASTABLE_THIS); }
kernel::~kernel() { pyopencl_call_guarded_cleanup(clReleaseKernel, PYOPENCL_CL_CASTABLE_THIS); }
program::~program() { pyopencl_call_guarded_cleanup(clReleaseProgram, this); }
context::~context() { pyopencl_call_guarded_cleanup(clReleaseContext, PYOPENCL_CL_CASTABLE_THIS); }
kernel::~kernel() { pyopencl_call_guarded_cleanup(clReleaseKernel, this); }