OpenCL-Docs
OpenCL-Docs copied to clipboard
Clarify the scope of clEnqueueAcquireExternalMemObjectsKHR and clEnqueueReleaseExternalMemObjectsKHR
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.
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.
This proposal looks reasonable.