示例#1
0
文件: mem.cpp 项目: Agorath/freeocl
	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;
	}
示例#2
0
文件: mem.cpp 项目: Agorath/freeocl
	cl_int clRetainMemObjectFCL (cl_mem memobj)
	{
		MSG(clRetainMemObjectFCL);
		if (!FreeOCL::is_valid(memobj))
			return CL_INVALID_MEM_OBJECT;

		memobj->retain();
		memobj->unlock();
		return CL_SUCCESS;
	}