Increments the memory object reference count.

cl_int clRetainMemObject(cl_mem memobj)

Parameters

memobj

A valid memory object.

Notes

clCreateBuffer, clCreateSubBuffer, clCreateImage, and clCreatePipe perform an implicit retain.

Errors

Returns CL_SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:

  • CL_INVALID_MEM_OBJECT if memobj is a not a valid memory object (buffer or image object).

  • CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

  • CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

Also see

Specification