Skip to content

[SYCL] Fix AMD GPU architecture detection#22670

Open
zjin-lcf wants to merge 1 commit into
intel:syclfrom
zjin-lcf:fix-amd-arch-detection
Open

[SYCL] Fix AMD GPU architecture detection#22670
zjin-lcf wants to merge 1 commit into
intel:syclfrom
zjin-lcf:fix-amd-arch-detection

Conversation

@zjin-lcf

Copy link
Copy Markdown
Contributor

get_architecture() stripped the feature-suffix (e.g. ":sramecc+:xnack-") from the device version string using string_view::substr, but then passed the view's .data() to a helper taking a const char*. Since .data() points into the original, non-truncated buffer, the lookup compared against the full "gfx942:sramecc+:xnack-" string and never matched, yielding architecture::unknown for AMD GPUs whose gcnArchName carries feature flags.

get_architecture() stripped the feature-suffix (e.g. ":sramecc+:xnack-")
from the device version string using string_view::substr, but then passed
the view's .data() to a helper taking a const char*. Since .data() points
into the original, non-truncated buffer, the lookup compared against the
full "gfx942:sramecc+:xnack-" string and never matched, yielding
architecture::unknown for AMD GPUs whose gcnArchName carries feature flags.

NVIDIA is unaffected because its version string ("7.5" style) has no ':'
to truncate. Take a std::string_view in the helper and pass the bounded
substring so the comparison respects the truncation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@zjin-lcf
zjin-lcf requested a review from a team as a code owner July 18, 2026 20:37
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