[NFCI][SYCL] Change device_image_impl::MDevices
to store raw device_impl *
#19459
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#18251 extended
device_impl
s' lifetimes until shutdown and #18270 started to pass devices as raw pointers in some of the APIs.This PR builds on top of that and extends usage of raw pointers/references/
device_range
as the devices are known to be alive and extrastd::shared_ptr
's atomic increments aren't necessary and could be avoided.Since we change the type of
device_image_impl::MDevices
, other APIs in that class and inprogram_manager
don't need to operate in terms ofsycl::device
orstd::shared_ptr<device_impl>
and we can switch them to usedevices_range
instead. A small number of other modifications are caused by these APIs' changes and are necessary to keep the code buildable.One extra change is the addition of a minor
devices_range::to<std::vector<ur_device_handle_t>>()
helper that we can use now that most of the arguments aredevice_range
. Technically, could go in another PR but then we'd just be modifying the exact same lines two times, so I decided to fuse it here.