Skip to content

[SYCL][Driver] Select the device sanitizer library for all intel_gpu_* aliases - #23494

Merged
KornevNikita merged 3 commits into
intel:syclfrom
srividya-sundaram:sycl-sanitizer-lib-intel-gpu-alias
Oct 15, 2026
Merged

KornevNikita merged 3 commits into
intel:syclfrom
srividya-sundaram:sycl-sanitizer-lib-intel-gpu-alias

Conversation

@srividya-sundaram

Copy link
Copy Markdown
Contributor

Fixes #23490.

The device sanitizer library was selected by comparing -fsycl-targets with the exact strings intel_gpu_pvc and intel_gpu_dg2*, so aliases such as intel_gpu_12_60_7 (PVC) or intel_gpu_12_55_8 and intel_gpu_acm_g10 (DG2) got the generic library. The alias is now resolved first.

Split out of #23441, which moves users from -device 12.60.7 to intel_gpu_<arch>.

…* aliases

The device sanitizer library was selected by comparing the -fsycl-targets
value with the exact strings intel_gpu_pvc and intel_gpu_dg2*, so aliases of
the same devices, e.g. intel_gpu_12_60_7 for PVC or intel_gpu_12_55_8 and
intel_gpu_acm_g10 for DG2, got the generic library. Resolve the alias to the
device first, as done for -device with spir64_gen.
@srividya-sundaram srividya-sundaram added the new-offload-model Enables testing with NewOffloadModel. label Oct 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

1 open finding
What changed in this PR

This PR fixes SYCL device sanitizer library selection for Intel GPU target aliases by resolving intel_gpu_* aliases to their canonical Gen device first, ensuring PVC/DG2 aliases get the correct sanitizer bitcode libraries.

Changes:

  • Add driver logic to resolve intel_gpu_* targets before selecting PVC/DG2 sanitizer libraries.
  • Extend driver tests to cover sanitizer library selection for PVC/DG2 alias targets (e.g., intel_gpu_12_60_7, intel_gpu_12_55_8, intel_gpu_acm_g10).
File Description
clang/​test/​Driver/​sycl-device-lib.cpp Adds RUN lines to validate sanitizer library selection for additional Intel GPU alias targets.
clang/​lib/​Driver/​ToolChains/​SYCL.cpp Resolves Intel GPU aliases prior to deciding which device sanitizer library set (PVC/DG2) to link.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread clang/lib/Driver/ToolChains/SYCL.cpp Outdated

@iclsrc iclsrc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The change looks correct. getSingleBuildTarget now resolves intel_gpu_* aliases through resolveGenDevice. As a result, intel_gpu_12_60_7 selects the PVC sanitizer library, and intel_gpu_12_55_8 and intel_gpu_acm_g* select the DG2 library, as do intel_gpu_dg2 and intel_gpu_dg2_g*. The old starts_with("intel_gpu_dg2") behavior is preserved, because dg2_g10/11/12 resolve to acm_g10/11/12. I only read the code and did not build or run the tests. I found no correctness issues. The tests cover the new aliases for the ASan, MSan and TSan PVC paths and the ASan DG2 path. I left one minor readability suggestion inline.

Comment thread clang/lib/Driver/ToolChains/SYCL.cpp Outdated
@srividya-sundaram
srividya-sundaram marked this pull request as ready for review October 15, 2026 01:52
@srividya-sundaram
srividya-sundaram requested a review from a team as a code owner October 15, 2026 01:52
Comment thread clang/lib/Driver/ToolChains/SYCL.cpp
@sys-ce-bb

Copy link
Copy Markdown
Contributor

@intel/llvm-gatekeepers please consider merging

@KornevNikita
KornevNikita merged commit b56b035 into intel:sycl Oct 15, 2026
62 of 64 checks passed
srividya-sundaram added a commit to srividya-sundaram/llvm that referenced this pull request Oct 19, 2026
The bundler, runtime and sanitizer library fixes have landed in sycl
(intel#23491, intel#23493, intel#23494), so their copies are dropped here. The linker
wrapper fix is updated to the version in intel#23492.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-offload-model Enables testing with NewOffloadModel.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SYCL][Driver] Device sanitizer library is not selected for intel_gpu_* aliases such as intel_gpu_12_60_7

6 participants