clRetainMemObject

Notes

After the memobj reference count becomes zero and
commands queued for execution on a command-queue(s) that use memobj have finished, the
memory object is deleted.

Errors

clRetainMemObject returns CL_SUCCESS if the function is
executed successfully. It returns CL_INVALID_MEM_OBJECT if memobj is not a valid memory object. clCreateBuffer and clCreateImage2D and clCreateImage3D perform an implicit retain.