Semaphores and Associated Devices
The query for clGetSemaphoreInfoKHR(CL_SEMAPHORE_DEVICE_HANDLE_LIST_KHR) says:
Returns the list of OpenCL devices the semaphore is associated with.
But, the spec is ambiguous how to "associate" a device with a semaphore, in particular in the cases when there is no explicit device handle list passed when the semaphore is created.
For example, consider:
If CL_SEMAPHORE_DEVICE_HANDLE_LIST_KHR is not specified as part of sema_props, the semaphore object created by clCreateSemaphoreWithPropertiesKHR is by default accessible to all devices in the context.
Should this say "is by default associated with" instead of "is by default accessible to"?
Depending how we resolve this we may be able to clean up several error code conditions also. For example, instead of:
- CL_INVALID_COMMAND_QUEUE ... if the device associated with command_queue is not same as one of the devices specified by CL_SEMAPHORE_DEVICE_HANDLE_LIST_KHR at the time of creating one or more of sema_objects.
We could just say "if the device associated with command_queue is not associated with the semaphore", or similar.