-
Notifications
You must be signed in to change notification settings - Fork 796
[SYCL] Make sycl::device use raw device_impl * for its impl
#20821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sycl
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to add explicit detail:: are related to #20820, caused by not including sycl::detail namespace into sycl::device's ADL because of the dropped inheritance.
| platform_impl::platform_impl(ur_platform_handle_t APlatform, | ||
| adapter_impl &Adapter) | ||
| : MPlatform(APlatform), MAdapter(&Adapter) { | ||
|
|
||
| // Find out backend of the platform | ||
| ur_backend_t UrBackend = UR_BACKEND_UNKNOWN; | ||
| Adapter.call_nocheck<UrApiKind::urPlatformGetInfo>( | ||
| APlatform, UR_PLATFORM_INFO_BACKEND, sizeof(ur_backend_t), &UrBackend, | ||
| nullptr); | ||
| MBackend = convertUrBackend(UrBackend); | ||
| } | ||
|
|
||
| platform_impl::~platform_impl() = default; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to move to .cpp because it now needs a "complete" device_impl type for MDevices.
`device_impl`s are owned by the parent platforms and are only destroyed when SYCL RT is unloaded. As such, there is no reason to pay the price of a `std::shared_ptr` a raw non-owning pointers is enough. Use a pointer and not a reference because `sycl::device` is assignable.
070d79a to
1b0dc36
Compare
device_impls are owned by the parent platforms and are only destroyed when SYCL RT is unloaded. As such, there is no reason to pay the price of astd::shared_ptr, a raw non-owning pointers is enough.Use a pointer and not a reference because
sycl::deviceis assignable.