PUBLIC cl_int clReleaseMemObject(cl_mem obj) { if (!obj) return CL_INVALID_MEM_OBJECT; if (obj->release()) delete obj; return CL_SUCCESS; }
cl_int clReleaseMemObjectFCL (cl_mem memobj) { MSG(clReleaseMemObjectFCL); if (!FreeOCL::is_valid(memobj)) return CL_INVALID_MEM_OBJECT; memobj->release(); if (memobj->get_ref_count() == 0) { memobj->invalidate(); memobj->unlock(); delete memobj; } else memobj->unlock(); return CL_SUCCESS; }