-
Notifications
You must be signed in to change notification settings - Fork 801
[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
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
|
@intel/sycl-graphs-reviewers @reble @KseniyaTikhomirova @sergey-semenov @steffenlarsen A gentle ping for review. Thanks! |
steffenlarsen
left a comment
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.
This LGTM, but beware that it will change ABI in a way that is likely to affect a lot of applications. ABI window is open, but better be aware.
adamfidel
left a comment
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.
The change to the CommandGraph unit test looks good to me.
|
@intel/llvm-gatekeepers Please consider merging. |
|
@intel/llvm-gatekeepers, this PR breaks pre-/post-commit CI on Windows. |
Here's the fix: #20902 |
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.