CL_DEVICE_HANDLE_LIST_KHR can be passed to clCreateBufferWithProperties or clCreateImageWithProperties to restrict which devices in the context import the external memory described by an external memory handle. The specification does not however state what happens when CL_DEVICE_HANDLE_LIST_KHR is provided (especially if the list does not contain all the devices that are part of the context) but no external memory handle is provided. A few possible options:
- Ignore the device list.
- Restrict which devices can use the memory object even though it wouldn't be imported (feels weird to introduce this with
cl_khr_external_memory).
- Report an error. We could add a rule stating that an external memory handle must be provided when
CL_DEVICE_HANDLE_LIST_KHR is and require implementations to report CL_INVALID_PROPERTY otherwise.
- Report an error when the device list does not contain all the devices that are in the context.
I think I have a preference for option 3. Thoughts?