Repository navigation
[SYCL][Driver][Test] Apply --no-offloadlib and -fno-sycl-instrument-device-code for 3 SYCL driver tests - #23602
Conversation
Signed-off-by: jinge90 <ge.jin@intel.com>
|
Hi, @intel/dpcpp-clang-driver-reviewers |
1 similar comment
|
Hi, @intel/dpcpp-clang-driver-reviewers |
|
@intel/llvm-gatekeepers please consider merging |
|
Hi, @intel/llvm-gatekeepers |
Signed-off-by: jinge90 <ge.jin@intel.com>
|
Hi, @srividya-sundaram |
There was a problem hiding this comment.
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
These modified RUN lines drop-ccc-install-dir %{clang_install_dir}while adjacent RUN lines in… · New These modified RUN lines drop-ccc-install-dir %{clang_install_dir}while adjacent RUN lines in… · New These modified RUN lines drop-ccc-install-dir %{clang_install_dir}while adjacent RUN lines in… · New
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/SYCLusage with--no-offloadlib -fno-sycl-instrument-device-codein targeted SYCL driver tests. - Adjust specific
sycl-offload.cppRUN 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 \ |
| // 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>
There was a problem hiding this comment.
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
9 open issues
This file previously used/clang:--sysroot=%S/Inputs/SYCLon many%clang_clinvocations. Even… · New This file previously used/clang:--sysroot=%S/Inputs/SYCLon many%clang_clinvocations. Even… · New This file previously used/clang:--sysroot=%S/Inputs/SYCLon many%clang_clinvocations. Even… · New These RUN lines also drop the sysroot entirely. IfInputs/SYCLwas providing the minimal Windows… · New These RUN lines also drop the sysroot entirely. IfInputs/SYCLwas providing the minimal Windows… · New These RUN lines drop-ccc-install-dir %{clang_install_dir}compared to the previous version, but… · New These modified RUN lines drop-ccc-install-dir %{clang_install_dir}while adjacent RUN lines in… These modified RUN lines drop-ccc-install-dir %{clang_install_dir}while adjacent RUN lines in… These modified RUN lines drop-ccc-install-dir %{clang_install_dir}while adjacent RUN lines in…
Review effort: Lite
|
|
||
| /// (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 \ |
There was a problem hiding this comment.
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 \ |
| // 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 \ |
|
Hi, @intel/llvm-gatekeepers Thanks very much! |


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.