Skip to content

[SYCL] Fix AMD GPU architecture detection#22670

Merged
sarnex merged 1 commit into
intel:syclfrom
zjin-lcf:fix-amd-arch-detection
Jul 20, 2026
Merged

[SYCL] Fix AMD GPU architecture detection#22670
sarnex merged 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>
@sys-ce-bb

Copy link
Copy Markdown
Contributor

@intel/llvm-gatekeepers please consider merging

@sarnex

sarnex commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Hi @zjin-lcf ,
Please check out https://llvm.org/docs/DeveloperPolicy.html#email-addresses - you'd have to change your Github account setting to allow committing from your personal/company email address. We don't allow committing from anonymous email addresses (like from noreply.github.com). Just changing your Github account settings should suffice - you don't have update the commits to include your personal email.
Thanks

@zjin-lcf

Copy link
Copy Markdown
Contributor Author

I will change my account setting. You are welcome.

@sarnex
sarnex merged commit b4d49f5 into intel:sycl Jul 20, 2026
30 of 31 checks passed
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.

4 participants