Skip to content

[NFCI][SYCL] Keep raw ptr/ref to devices/platforms in context_impl #19629

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

Open
wants to merge 2 commits into
base: sycl
Choose a base branch
from

Conversation

aelovikov-intel
Copy link
Contributor

@aelovikov-intel aelovikov-intel commented Jul 29, 2025

Similar to #19613.

Refactoring has started in
#18143
#18251

Similar to intel#19613.

Refactoring has started in
intel#18143
intel#18251

This didn't work back then due to some unittests failing (because
`global_handler` shutdown is different with unittests) but it doesn't
seem to be an issue any more, probably due to other refactoring PRs that
prefer raw ptr/refs over `std::shared_ptr` elsewhere.
@@ -15,8 +15,15 @@ inline namespace _V1 {
namespace ext::oneapi::experimental::this_thread {

namespace detail {
inline sycl::device &get_current_device_ref() {
static thread_local sycl::device current_device{sycl::default_selector_v};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that could extend sycl::device's lifetime past global_handler destruction when running our unittests, but that device wasn't really usable because we've already released all the UR resources at that point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant