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.
I'm trying to implement
cl_khr_icdversion 2.0.0 and I'm curious on the semantics ofclIcdSetPlatformDispatchDataKHRin regards tocl_device_idobjects.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_idevery timeclGetDeviceIDsgets called and reuse them internally. At least I don't think there was a reason that prevented this.Now with
cl_khr_icdversion 2.0.0 each object returned has thisdispatch_datafield, and an implementation may initialize thecl_device_idbefore or after theclIcdSetPlatformDispatchDataKHRcall.My assumption is, that the ICD loader will do so on its initialization routine, so an implementation could just update the
dispatch_datafield of all already createdcl_device_idobjects insideclIcdSetPlatformDispatchDataKHR.What I'm more curious about is, is the ICD loader allowed to call
clIcdSetPlatformDispatchDataKHRlater on again? What ifclGetDeviceIDsgets called again? Do the devices have to contain the updateddispatch_datavalue potentially updating it also for previously returnedcl_device_idobjects?Is the assumption that
clIcdSetPlatformDispatchDataKHRgets 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.