Skip to content

[NFCI][SYCL] Use get_info_impl (not _nocheck) for USM info descriptors #18453

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

Merged
merged 1 commit into from
May 14, 2025

Conversation

aelovikov-intel
Copy link
Contributor

@aelovikov-intel aelovikov-intel commented May 13, 2025

I tracked the appearance of _nocheck down to
#937 and James doesn't remember anything specific requiring that vs "checked" version. Also, some similar USM-related aspects (those that don't just delegate to get_info) do use "checked" APIs, so it seems logical to unify this processing.

The main reason I do this is that it would be a bit easier to cache the values of "checked" interfaces by pre-computing USM support in device_impl's ctor. Note that we perform at least some of those every time we allocate USM memory, so doing the caching is desirable (even for the sake of cleaning up our traces).

…ptors

I tracked the appearance of `_nocheck` down to
intel#937 and James doesn't remember
anything specific requiring that vs "checked" version. Also, some
similar USM-related aspects (those that don't just delegate to
`get_info`) do use "checked" APIs, so it seems logical to unify this
processing.

The main reason I do this is that it would be a bit easier to cache the
values of "checked" interfaces by pre-computing USM support in
`device_impl`'s ctor. Note that we perform at least some of those every
time we allocate USM memory, so doing the caching is desirable (even for
the sake of cleaning up our traces).
@aelovikov-intel aelovikov-intel requested a review from a team as a code owner May 13, 2025 21:10
@aelovikov-intel aelovikov-intel changed the title [NFCI][SYCL] Use get_info_impl (not _nocheck) for USM info descri… [NFCI][SYCL] Use get_info_impl (not _nocheck) for USM info descriptors May 13, 2025
@@ -589,33 +589,27 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
}

CASE(info::device::usm_device_allocations) {
return get_info_impl_nocheck<UR_DEVICE_INFO_USM_DEVICE_SUPPORT>()
.value_or(0) &
return get_info_impl<UR_DEVICE_INFO_USM_DEVICE_SUPPORT>() &
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@intel/unified-runtime-reviewers , are any of these APIs expected to return a meaningful error that isn't an indication of everything being terribly broken?

Copy link
Contributor

Choose a reason for hiding this comment

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

no, these aren't optional queries so it should be success or catastrophic failure as you say

Copy link
Contributor

@maarquitos14 maarquitos14 left a comment

Choose a reason for hiding this comment

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

LGTM.

@aelovikov-intel aelovikov-intel merged commit 635bf3c into intel:sycl May 14, 2025
36 of 37 checks passed
@aelovikov-intel aelovikov-intel deleted the checked-usm-info branch May 14, 2025 15:12
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.

3 participants