OpenCL-Docs icon indicating copy to clipboard operation
OpenCL-Docs copied to clipboard

Clarify the scope of clEnqueueAcquireExternalMemObjectsKHR and clEnqueueReleaseExternalMemObjectsKHR

Open nikhiljnv opened this issue 11 months ago • 1 comments

The spec doesn't say clearly if the acquire and release calls are supposed to be applicable for external memobj usage across command queues, devices of the context or are limited to the usage on the particular command queue it is acquired/released on. Need to discuss and clarify one way or the other.

nikhiljnv avatar Mar 04 '24 04:03 nikhiljnv

Proposal:

  • Acquiring or Releasing an external memory object must be performed by a command queue associated with a device in the device handle list associated with the memory object(s). We already have an error condition that covers this case, but it would be good to say this more explicitly.
  • Acquiring or Releasing an external memory object acquires the memory object for all devices in the device handle list, and not just the device associated with the command queue. Importantly though, it does NOT acquire the memory object for all devices in the context, if there are devices in the context that are not in the device handle list associated with the memory object(s).

Note: this is slightly different than the behavior for other types of sharing (e.g. CL-GL sharing, or CL-DX sharing) because they do not have the concept of a device handle list.

bashbaug avatar Mar 05 '24 18:03 bashbaug

This proposal looks reasonable.

bcalidas avatar May 20 '24 22:05 bcalidas