-
Notifications
You must be signed in to change notification settings - Fork 124
Description
I'm trying to implement cl_khr_icd version 2.0.0 and I'm curious on the semantics of clIcdSetPlatformDispatchDataKHR in regards to cl_device_id objects.
The spec states that "The vendor driver is responsible for propagating the dispatch_data value when returning objects to users.", however implementations might not return new cl_device_id every time clGetDeviceIDs gets called and reuse them internally. At least I don't think there was a reason that prevented this.
Now with cl_khr_icd version 2.0.0 each object returned has this dispatch_data field, and an implementation may initialize the cl_device_id before or after the clIcdSetPlatformDispatchDataKHR call.
My assumption is, that the ICD loader will do so on its initialization routine, so an implementation could just update the dispatch_data field of all already created cl_device_id objects inside clIcdSetPlatformDispatchDataKHR.
What I'm more curious about is, is the ICD loader allowed to call clIcdSetPlatformDispatchDataKHR later on again? What if clGetDeviceIDs gets called again? Do the devices have to contain the updated dispatch_data value potentially updating it also for previously returned cl_device_id objects?
Is the assumption that clIcdSetPlatformDispatchDataKHR gets only called exactly once and none of those issues are of any concern? I'm assuming this was the intention, but I think it would be better to clarify the expectations here.