Skip to content

[NewOffloadModel] Add support for passing backend options for multiple device architectures#21140

Draft
YixingZhang007 wants to merge 19 commits intointel:syclfrom
YixingZhang007:modify_device_compiler_opt
Draft

[NewOffloadModel] Add support for passing backend options for multiple device architectures#21140
YixingZhang007 wants to merge 19 commits intointel:syclfrom
YixingZhang007:modify_device_compiler_opt

Conversation

@YixingZhang007
Copy link
Contributor

@YixingZhang007 YixingZhang007 commented Jan 27, 2026

This patch adds the support of passing different backend options through -Xsycl-target-backend for each of multiple device architectures.
An example is like the following, where we are passing different options for pvc and dg1.

clang++ ... -fsycl-targets=intel_gpu_dg1,spir64_gen \
  -Xsycl-target-backend=spir64_gen "-device pvc -options -extraopt_pvc" \
  -Xsycl-target-backend=intel_gpu_dg1 "-options -extraopt_dg1" ...

The following changes are made to support this feature:

  1. In SYCL.cpp, add a new function extractDeviceFromArg for extracting the device from the backend option when the SYCL target is spir64_gen. This allows finding the device architecture from arguments such as: -Xsycl-target-backend=spir64_gen "-device pvc -options -extraopt_pvc"
  2. In Clang.cpp, we construct a --device-compiler=... argument to pass into clang-linker-wrapper for each SYCL target. The --device-compiler contains a -device <arch> to differentiate the device that the backend option is specified for. When the SYCL target is spir64_gen (not intel_gpu_arch), we call extractDeviceFromArg to extract the device architecture.
  3. clang-linker-wrapper is updated to filter OPT_device_compiler_args_EQ based on the architecture, and specify each architecture when calling sycl-post-link.
  4. sycl-post-link is updated to support multiple architectures being passed in, such that cases like: -Xsycl-target-backend=spir64_gen "-device arch1,arch2"
  5. Added a new test in sycl-offload-new-driver.cpp to verify the changes.

@YixingZhang007 YixingZhang007 force-pushed the modify_device_compiler_opt branch from 1ccdc0d to bee0746 Compare February 16, 2026 06:33
@YixingZhang007 YixingZhang007 added the new-offload-model Enables testing with NewOffloadModel. label Feb 16, 2026
@YixingZhang007 YixingZhang007 force-pushed the modify_device_compiler_opt branch from bee0746 to e3dffc7 Compare February 16, 2026 17:59
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.

1 participant