Skip to content

Conversation

@aelovikov-intel
Copy link
Contributor

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 a std::shared_ptr, a raw non-owning pointers is enough.

Use a pointer and not a reference because sycl::device is assignable.

Copy link
Contributor Author

@aelovikov-intel aelovikov-intel left a 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.

Comment on lines +33 to +46
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;

Copy link
Contributor Author

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.
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