Skip to content

[SYCL][Driver][Test] Apply --no-offloadlib and -fno-sycl-instrument-device-code for 3 SYCL driver tests - #23602

Merged
sarnex merged 4 commits into
intel:syclfrom
jinge90:apply_offloadlib_for_2_driver_tests
Oct 28, 2026
Merged

sarnex merged 4 commits into
intel:syclfrom
jinge90:apply_offloadlib_for_2_driver_tests

Conversation

@jinge90

@jinge90 jinge90 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

sycl-c-warn.c applies '--sysroot=%S/Inputs/SYCL --no-offloadlib', we don't need '--sysroot' if using '--no-offloadlib' to get rid of devicelibs. So, update the test to '--no-offloadlib -fno-sycl-instrument-device-code' to totally get rid of devicelibs.
sycl-allow-device-image-deps-win.cpp: every check is about the host link line, the devicelibs are not needed, so remove unnecessary sysroot and replace it with '--no-offloadlib -fno-sycl-instrument-device-code'.
sycl-offload.cpp: some lines are to test driver doesn't report error when target triple is valid 32-bit spir/v targets in new offload driver mode, all devicelibs only provide 64-bit version, so adding '--no-offloadlib and -fno-sycl-instrument-device-code' for these lines. We also apply no-offloadlib for adjacent lines for spir64 because these lines are to check target triple, devicelibs are not required, align spir32 with spir64 for the tests will not be confusing.

@jinge90
jinge90 requested a review from a team as a code owner October 23, 2026 07:48
@jinge90

jinge90 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Hi, @intel/dpcpp-clang-driver-reviewers
Could you help review this PR?
Thanks very much.

1 similar comment
@jinge90

jinge90 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Hi, @intel/dpcpp-clang-driver-reviewers
Could you help review this PR?
Thanks very much.

@sys-ce-bb

Copy link
Copy Markdown
Contributor

@intel/llvm-gatekeepers please consider merging

@jinge90

jinge90 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Hi, @intel/llvm-gatekeepers
Could you help merge this PR?
Thanks very much.

@jinge90 jinge90 changed the title [SYCL][Driver][Test] Apply --no-offloadlib and -fno-sycl-instrument-device-code for 2 SYCL driver tests [SYCL][Driver][Test] Apply --no-offloadlib and -fno-sycl-instrument-device-code for 3 SYCL driver tests Oct 27, 2026
@jinge90

jinge90 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi, @srividya-sundaram
I applied '--no-offloadlib -fno-sycl-instrument-device-code' to sycl-offload.cpp in latest commit, the reason is some lines in the test are testing 32-bit spir/spirv target and all deivcelibs and incoming libc.bc only support 64-bit, so disable devicelibs for these lines in new offload driver to avoid error report.
Could you help review again?
Thanks very much.

@jinge90
jinge90 requested a balanced review from Copilot October 27, 2026 06:37

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

3 open issues
What changed in this PR

Updates several SYCL driver tests to avoid pulling in device libraries by using --no-offloadlib together with -fno-sycl-instrument-device-code, removing now-unnecessary --sysroot usage in these scenarios.

Changes:

  • Replace --sysroot=%S/Inputs/SYCL usage with --no-offloadlib -fno-sycl-instrument-device-code in targeted SYCL driver tests.
  • Adjust specific sycl-offload.cpp RUN lines (notably for 32-bit SPIR/SPIR-V target coverage) to avoid device library requirements.
  • Simplify Windows linker-dependency tests to focus on host link-line behavior without SYCL device libs.
File Description
clang/​test/​Driver/​sycl-offload.cpp Adds --no-offloadlib + disables device instrumentation on select target-triple RUN lines to avoid device libs.
clang/​test/​Driver/​sycl-c-warn.c Drops SYCL sysroot dependency in warning test by relying on --no-offloadlib + disabling instrumentation.
clang/​test/​Driver/​sycl-allow-device-image-deps-win.cpp Removes SYCL sysroot dependency across link-line checks and uses --no-offloadlib + disabling instrumentation instead.

Review effort: Lite


/// Check no error for -fsycl-targets with good triple
// RUN: %clang -### -fsycl-targets=spir-unknown-unknown -fsycl --offload-new-driver -ccc-install-dir %{clang_install_dir} %s 2>&1 \
// RUN: %clang -### -fsycl-targets=spir-unknown-unknown -fsycl --offload-new-driver --no-offloadlib -fno-sycl-instrument-device-code %s 2>&1 \
Comment on lines +62 to +64
// RUN: %clang_cl -### -fsycl-targets=spir-unknown-unknown -fsycl --offload-new-driver --no-offloadlib -fno-sycl-instrument-device-code %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-SYCL-TARGET %s
// RUN: %clang -### -fsycl-targets=spirv32-unknown-unknown -fsycl --offload-new-driver -ccc-install-dir %{clang_install_dir} %s 2>&1 \
// RUN: %clang -### -fsycl-targets=spirv32-unknown-unknown -fsycl --offload-new-driver --no-offloadlib -fno-sycl-instrument-device-code %s 2>&1 \
// RUN: %clang -### -fsycl-targets=spirv64-unknown-unknown -fsycl --offload-new-driver -ccc-install-dir %{clang_install_dir} %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-SYCL-TARGET %s
// RUN: %clang -### -fsycl-targets=spirv32 -fsycl --offload-new-driver -ccc-install-dir %{clang_install_dir} %s 2>&1 \
// RUN: %clang -### -fsycl-targets=spirv32 -fsycl --offload-new-driver --no-offloadlib -fno-sycl-instrument-device-code %s 2>&1 \
Signed-off-by: jinge90 <ge.jin@intel.com>
@jinge90
jinge90 requested a balanced review from Copilot October 27, 2026 07:27

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.


/// (1) Full path named directly as an input.
// RUN: %clang_cl -fsycl /clang:--sysroot=%S/Inputs/SYCL \
// RUN: %clang_cl -fsycl --no-offloadlib -fno-sycl-instrument-device-code \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The sysroot applied before is for locating dummy devicelibs, with '--no-offloadlib -fno-sycl-instrument-device-code', we don't need it anymore.


/// (2) Full path passed through /link.
// RUN: %clang_cl -fsycl /clang:--sysroot=%S/Inputs/SYCL \
// RUN: %clang_cl -fsycl --no-offloadlib -fno-sycl-instrument-device-code \

/// (4) Bare name via /link, resolved through the LIB env var.
// RUN: env "LIB=%t.libdir" %clang_cl -fsycl /clang:--sysroot=%S/Inputs/SYCL \
// RUN: env "LIB=%t.libdir" %clang_cl -fsycl --no-offloadlib -fno-sycl-instrument-device-code \
// RUN: echo '#pragma comment(lib, "dep.lib")' > %t.dep.c
// RUN: %clang_cl /clang:--sysroot=%S/Inputs/SYCL -c -o %t.dep.obj %t.dep.c
// RUN: %clang_cl -fsycl /clang:--sysroot=%S/Inputs/SYCL \
// RUN: %clang_cl -c -o %t.dep.obj %t.dep.c
/// -fsycl-allow-device-image-dependencies without -fsycl.
// RUN: %clang_cl /clang:--sysroot=%S/Inputs/SYCL \
// RUN: -fsycl-allow-device-image-dependencies /O2 -### %s \
// RUN: %clang_cl -fsycl-allow-device-image-dependencies /O2 -### %s \
Comment on lines +58 to +62
// RUN: %clang -### -fsycl-targets=spir-unknown-unknown -fsycl --offload-new-driver --no-offloadlib -fno-sycl-instrument-device-code %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-SYCL-TARGET %s
// RUN: %clang -### -fsycl-targets=spir64 -fsycl --offload-new-driver -ccc-install-dir %{clang_install_dir} %s 2>&1 \
// RUN: %clang -### -fsycl-targets=spir64 -fsycl --offload-new-driver --no-offloadlib -fno-sycl-instrument-device-code %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHK-SYCL-TARGET %s
// RUN: %clang_cl -### -fsycl-targets=spir-unknown-unknown -fsycl --offload-new-driver -ccc-install-dir %{clang_install_dir} %s 2>&1 \
// RUN: %clang_cl -### -fsycl-targets=spir-unknown-unknown -fsycl --offload-new-driver --no-offloadlib -fno-sycl-instrument-device-code %s 2>&1 \
@jinge90
jinge90 requested a review from a team October 28, 2026 02:09
@jinge90

jinge90 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Hi, @intel/llvm-gatekeepers
Could you help merge this PR? The failure in pre-ci is due to Window system hang and this PR only touches 3 driver lit tests, the pre-ci failure is for e2e test.

Thanks very much!

@sarnex
sarnex merged commit c361723 into intel:sycl Oct 28, 2026
40 of 43 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.

5 participants