Adds newget_per_device_resource_ref(), set_per_device_resource_ref() and current_device versions of these, intended to replace get_per_device_resource(). The new functions deal in device_async_resource_ref, while the old functions deal in device_memory_resource pointers. Tests are updated to use the new functions.
Note that I have also added reset_per_device_resource_ref() and reset_current_device_resource_ref() which are necessary because previously we implemented the resetting behavior by passing nullptr to set_current_device_resource(), which doesn't work with resource_ref because it can't refer to nullptr (no such thing as a null reference).
Also needed to update some adaptors (statistics, tracking) to take a resource_ref at construction. This is a preview of updating all adaptors to work this way. This was needed because they needed to work with get/set_current_resource_ref().
Description
Fixes #1597
Depends on #1589
Adds new
get_per_device_resource_ref()
,set_per_device_resource_ref()
andcurrent_device
versions of these, intended to replaceget_per_device_resource()
. The new functions deal indevice_async_resource_ref
, while the old functions deal indevice_memory_resource
pointers. Tests are updated to use the new functions.Note that I have also added
reset_per_device_resource_ref()
andreset_current_device_resource_ref()
which are necessary because previously we implemented the resetting behavior by passingnullptr
toset_current_device_resource()
, which doesn't work withresource_ref
because it can't refer tonullptr
(no such thing as a null reference).Also needed to update some adaptors (statistics, tracking) to take a
resource_ref
at construction. This is a preview of updating all adaptors to work this way. This was needed because they needed to work withget/set_current_resource_ref()
.Checklist