Make RuntimeDeviceTracker default constructor non-public
It would be a cleaner implementation if we only allowed there to be a thread-single RuntimeDeviceTracker
than to have alternative trackers that are passed around to override the behavior (sometimes). The need to pass around trackers has pretty much been replaced with the newer DeviceAdapterId
functionality.
Tasks that we need to do:
-
Provide only a thread-single of RuntimeDeviceTracker
only -
Pull out the RuntimeDeviceTracker
argument toTryExecute
. I don’t really see an advantage to that anymore now that you can specify aDeviceAdapterId
. -
Update ScopedRuntimeDeviceTracker
to mimic the interface ofRuntimeDeviceTracker
where when you call one of these methods onScopedRuntimeDeviceTracker
it would call the equivalent method on the thread-single tracker (RuntimeDeviceTracker::GetRuntimeTracker()
). Thus,ScopedRuntimeDeviceTracker
could be used in the same way thatRuntimeDeviceTracker
was used previously, where you could create a tracker that modifies the device behavior while it is around. However, it has the added benefit that you don’t have to pass it around, so it affects every call down the stack no matter what. -
Document all the above changes in a changelog ( docs/changelog/redesign-runtime-device-tracking.md
).
Edited by Robert Maynard