Skip to content

Commit 483ea3b

Browse files
committed
Merge remote-tracking branch 'upstream/sycl' into rtc-build-options
2 parents 115f22b + 76c6653 commit 483ea3b

File tree

118 files changed

+3123
-1688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+3123
-1688
lines changed

.github/workflows/coverity.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ jobs:
4646
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
4747
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \
4848
--ci-defaults --hip --cuda \
49-
--cmake-opt="-DNATIVECPU_USE_OCK=Off" \
50-
--cmake-opt="-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV"
49+
-DNATIVECPU_USE_OCK=Off \
50+
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV
5151
5252
- name: Build with coverity
5353
run: $GITHUB_WORKSPACE/cov-analysis-linux64-*/bin/cov-build --dir cov-int cmake --build $GITHUB_WORKSPACE/build --target sycl-toolchain

.github/workflows/sycl-linux-build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ jobs:
163163
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
164164
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \
165165
--ci-defaults ${{ inputs.build_configure_extra_args }} \
166-
--cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache \
167-
--cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
168-
--cmake-opt="-DLLVM_INSTALL_UTILS=ON" \
169-
--cmake-opt="-DNATIVECPU_USE_OCK=Off" \
170-
--cmake-opt="-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV" \
166+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
167+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
168+
-DLLVM_INSTALL_UTILS=ON \
169+
-DNATIVECPU_USE_OCK=Off \
170+
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV \
171171
--level_zero_v1_and_v2
172172
- name: Compile
173173
id: build

.github/workflows/sycl-linux-precommit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd
7474
target_devices: hip:gpu
7575
reset_intel_gpu: false
76+
extra_lit_opts: -j 1
7677
- name: Intel Arc A-Series Graphics
7778
runner: '["Linux", "arc"]'
7879
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
@@ -111,13 +112,12 @@ jobs:
111112
runner: '["Linux", "bmg"]'
112113
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
113114
target_devices: level_zero:gpu
114-
# The new Xe kernel driver used by BMG doesn't support resetting.
115-
reset_intel_gpu: false
115+
reset_intel_gpu: true
116116
- name: SPIR-V Backend / Intel Battlemage Graphics
117117
runner: '["Linux", "bmg"]'
118118
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
119119
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
120-
reset_intel_gpu: false
120+
reset_intel_gpu: true
121121
extra_lit_opts: --param spirv-backend=True
122122
e2e_binaries_artifact: sycl_e2e_bin_default_spirv_backend
123123
uses: ./.github/workflows/sycl-linux-run-tests.yml

.github/workflows/sycl-linux-run-tests.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ on:
126126
- '["cts-cpu"]'
127127
- '["Linux", "build"]'
128128
- '["cuda"]'
129+
- '["PVC_PERF"]'
129130
image:
130131
type: choice
131132
options:
@@ -170,17 +171,14 @@ on:
170171
Extra options to be added to LIT_OPTS.
171172
default: ''
172173

173-
install_igc_driver:
174+
reset_intel_gpu:
175+
description: |
176+
Reset Intel GPUs
174177
type: choice
175178
options:
176179
- false
177180
- true
178181

179-
install_dev_igc_driver:
180-
type: choice
181-
options:
182-
- false
183-
- true
184182
e2e_testing_mode:
185183
type: choice
186184
options:
@@ -203,15 +201,22 @@ jobs:
203201
steps:
204202
- name: Reset Intel GPU
205203
if: inputs.reset_intel_gpu == 'true'
204+
shell: bash
206205
run: |
207-
sudo mount -t debugfs none /sys/kernel/debug
208-
base_dir="/sys/kernel/debug/dri"
206+
if [[ '${{ inputs.runner }}' == '["Linux", "bmg"]' ]]; then
207+
sudo bash -c 'echo 0000:05:00.0 > /sys/bus/pci/drivers/xe/unbind'
208+
sudo bash -c 'echo 1 > /sys/bus/pci/devices/0000:05:00.0/reset'
209+
sudo bash -c 'echo 0000:05:00.0 > /sys/bus/pci/drivers/xe/bind'
210+
else
211+
sudo mount -t debugfs none /sys/kernel/debug
212+
base_dir="/sys/kernel/debug/dri"
209213
210-
for dir in "$base_dir"/*; do
211-
if [ -f "$dir/i915_wedged" ]; then
212-
sudo bash -c 'echo 1 > $0/i915_wedged' $dir
213-
fi
214-
done
214+
for dir in "$base_dir"/*; do
215+
if [ -f "$dir/i915_wedged" ]; then
216+
sudo bash -c 'echo 1 > $0/i915_wedged' $dir
217+
fi
218+
done
219+
fi
215220
- uses: actions/checkout@v4
216221
with:
217222
ref: ${{ inputs.devops_ref || inputs.repo_ref }}

.github/workflows/sycl-macos-build-and-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ jobs:
5050
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
5151
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \
5252
--ci-defaults $ARGS \
53-
--cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache \
54-
--cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
55-
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
53+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
54+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
55+
-DLLVM_INSTALL_UTILS=ON
5656
- name: Compile
5757
run: cmake --build $GITHUB_WORKSPACE/build --target deploy-sycl-toolchain

.github/workflows/sycl-nightly.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
build_cache_root: "/__w/"
4444
build_cache_suffix: oneapi
4545
build_artifact_suffix: oneapi
46-
build_configure_extra_args: --cmake-opt=-DCMAKE_C_FLAGS="-no-intel-lib -ffp-model=precise" --cmake-opt=-DCMAKE_CXX_FLAGS="-no-intel-lib -ffp-model=precise"
46+
build_configure_extra_args: -DCMAKE_C_FLAGS="-no-intel-lib -ffp-model=precise" -DCMAKE_CXX_FLAGS="-no-intel-lib -ffp-model=precise"
4747
cc: icx
4848
cxx: icpx
4949

@@ -82,6 +82,7 @@ jobs:
8282
runner: '["Linux", "bmg"]'
8383
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
8484
target_devices: level_zero:gpu
85+
reset_intel_gpu: true
8586

8687
- name: Intel L0 Arc A-Series GPU
8788
runner: '["Linux", "arc"]'
@@ -247,7 +248,7 @@ jobs:
247248
sycl_cts_artifact: sycl_cts_bin
248249

249250
aggregate_benchmark_results:
250-
if: always() && !cancelled()
251+
if: github.repository == 'intel/llvm' && !cancelled()
251252
name: Aggregate benchmark results and produce historical averages
252253
uses: ./.github/workflows/sycl-benchmark-aggregate.yml
253254
secrets:
@@ -262,13 +263,8 @@ jobs:
262263
fail-fast: false
263264
matrix:
264265
include:
265-
- name: Run compute-benchmarks on L0 Gen12
266-
runner: '["Linux", "gen12"]'
267-
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
268-
target_devices: level_zero:gpu
269-
reset_intel_gpu: true
270266
- name: Run compute-benchmarks on L0 PVC
271-
runner: '["Linux", "pvc"]'
267+
runner: '["PVC_PERF"]'
272268
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
273269
target_devices: level_zero:gpu
274270
reset_intel_gpu: true

.github/workflows/sycl-post-commit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
build_cache_root: "/__w/llvm"
3838
build_cache_suffix: default
3939
build_artifact_suffix: default
40-
build_configure_extra_args: --no-assertions --hip --cuda --native_cpu --cmake-opt="-DSYCL_ENABLE_STACK_PRINTING=ON" --cmake-opt="-DSYCL_LIB_WITH_DEBUG_SYMBOL=ON"
40+
build_configure_extra_args: --no-assertions --hip --cuda --native_cpu -DSYCL_ENABLE_STACK_PRINTING=ON -DSYCL_LIB_WITH_DEBUG_SYMBOL=ON
4141

4242
e2e-lin:
4343
needs: [build-lin]
@@ -102,7 +102,7 @@ jobs:
102102
uses: ./.github/workflows/sycl-windows-build.yml
103103
with:
104104
compiler: icx
105-
build_configure_extra_args: --cmake-opt=-DCMAKE_C_FLAGS="/fp:precise /clang:-Wno-nonportable-include-path /clang:-Wno-cast-function-type-mismatch" --cmake-opt=-DCMAKE_CXX_FLAGS="/fp:precise /clang:-Wno-nonportable-include-path /clang:-Wno-cast-function-type-mismatch" --cmake-opt="-DCMAKE_EXE_LINKER_FLAGS=/manifest:no" --cmake-opt="-DCMAKE_MODULE_LINKER_FLAGS=/manifest:no" --cmake-opt="-DCMAKE_SHARED_LINKER_FLAGS=/manifest:no"
105+
build_configure_extra_args: -DCMAKE_C_FLAGS="/fp:precise /clang:-Wno-nonportable-include-path /clang:-Wno-cast-function-type-mismatch" -DCMAKE_CXX_FLAGS="/fp:precise /clang:-Wno-nonportable-include-path /clang:-Wno-cast-function-type-mismatch" -DCMAKE_EXE_LINKER_FLAGS=/manifest:no -DCMAKE_MODULE_LINKER_FLAGS=/manifest:no -DCMAKE_SHARED_LINKER_FLAGS=/manifest:no
106106
build_cache_suffix: icx
107107

108108
e2e-win:

.github/workflows/sycl-windows-build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ jobs:
124124
IF NOT EXIST D:\github\_work\cache\${{inputs.build_cache_suffix}} MKDIR D:\github\_work\cache\${{inputs.build_cache_suffix}}
125125
python.exe src/buildbot/configure.py -o build ^
126126
--ci-defaults %ARGS% ^
127-
--cmake-opt="-DCMAKE_C_COMPILER=${{inputs.compiler}}" ^
128-
--cmake-opt="-DCMAKE_CXX_COMPILER=${{inputs.compiler}}" ^
129-
--cmake-opt="-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^
130-
--cmake-opt="-DCMAKE_CXX_COMPILER_LAUNCHER=ccache" ^
131-
--cmake-opt="-DCMAKE_C_COMPILER_LAUNCHER=ccache" ^
132-
--cmake-opt="-DLLVM_INSTALL_UTILS=ON" ^
133-
--cmake-opt="-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV"
127+
"-DCMAKE_C_COMPILER=${{inputs.compiler}}" ^
128+
"-DCMAKE_CXX_COMPILER=${{inputs.compiler}}" ^
129+
"-DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\install" ^
130+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache ^
131+
-DCMAKE_C_COMPILER_LAUNCHER=ccache ^
132+
-DLLVM_INSTALL_UTILS=ON ^
133+
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV
134134
- name: Build
135135
id: build
136136
shell: bash

.github/workflows/ur-source-checks.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,8 @@ jobs:
4343
Expand-Archive -Path "$WorkingDir\doxygen.zip"
4444
Add-Content $env:GITHUB_PATH "$WorkingDir\doxygen"
4545
46-
- name: "[Lin] Install hwloc"
47-
working-directory: ${{github.workspace}}/unified-runtime
48-
if: matrix.os == 'ubuntu-22.04'
49-
run: .github/scripts/install_hwloc.sh
50-
51-
- name: "[Win] Install hwloc"
52-
working-directory: ${{github.workspace}}/unified-runtime
53-
if: matrix.os == 'windows-2022'
54-
run: vcpkg install hwloc:x64-windows
55-
5646
- name: Configure Unified Runtime project
5747
working-directory: ${{github.workspace}}/unified-runtime
58-
env:
59-
VCPKG_PATH: "C:/vcpkg/packages/hwloc_x64-windows"
6048
run: >
6149
cmake
6250
-B${{github.workspace}}/build
@@ -65,6 +53,7 @@ jobs:
6553
-DCMAKE_BUILD_TYPE=Debug
6654
-DUR_BUILD_TESTS=OFF
6755
-DUR_FORMAT_CPP_STYLE=ON
56+
-DUMF_DISABLE_HWLOC=ON
6857
6958
# Verifying license should be enough on a single OS
7059
- name: Verify that each source file contains a license

buildbot/configure.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77

88

9-
def do_configure(args):
9+
def do_configure(args, passthrough_args):
1010
# Get absolute path to source directory
1111
abs_src_dir = os.path.abspath(
1212
args.src_dir if args.src_dir else os.path.join(__file__, "../..")
@@ -255,6 +255,7 @@ def do_configure(args):
255255
]
256256
)
257257

258+
cmake_cmd += passthrough_args
258259
print("[Cmake Command]: {}".format(" ".join(map(shlex.quote, cmake_cmd))))
259260

260261
try:
@@ -417,11 +418,11 @@ def main():
417418
"--native-cpu-libclc-targets",
418419
help="Target triples for libclc, used by the Native CPU backend",
419420
)
420-
args = parser.parse_args()
421+
args, passthrough_args = parser.parse_known_intermixed_args()
421422

422423
print("args:{}".format(args))
423424

424-
return do_configure(args)
425+
return do_configure(args, passthrough_args)
425426

426427

427428
if __name__ == "__main__":

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11022,6 +11022,7 @@ static void getNonTripleBasedSYCLPostLinkOpts(const ToolChain &TC,
1102211022
const JobAction &JA,
1102311023
const llvm::opt::ArgList &TCArgs,
1102411024
ArgStringList &PostLinkArgs) {
11025+
1102511026
// See if device code splitting is requested
1102611027
if (Arg *A = TCArgs.getLastArg(options::OPT_fsycl_device_code_split_EQ)) {
1102711028
auto CodeSplitValue = StringRef(A->getValue());
@@ -11047,6 +11048,25 @@ static void getNonTripleBasedSYCLPostLinkOpts(const ToolChain &TC,
1104711048

1104811049
if (allowDeviceImageDependencies(TCArgs))
1104911050
addArgs(PostLinkArgs, TCArgs, {"-allow-device-image-dependencies"});
11051+
11052+
// For bfloat16 conversions LLVM IR devicelib, we only need to embed it
11053+
// when non-AOT compilation is used.
11054+
if (TC.getTriple().isSPIROrSPIRV() && !TC.getTriple().isSPIRAOT()) {
11055+
SYCLInstallationDetector SYCLInstall(TC.getDriver());
11056+
SmallVector<SmallString<128>, 4> DeviceLibLocCandidates;
11057+
SmallString<128> NativeBfloat16Name("libsycl-native-bfloat16.bc");
11058+
SYCLInstall.getSYCLDeviceLibPath(DeviceLibLocCandidates);
11059+
for (const auto &DeviceLibLoc : DeviceLibLocCandidates) {
11060+
SmallString<128> FullLibName(DeviceLibLoc);
11061+
llvm::sys::path::append(FullLibName, NativeBfloat16Name);
11062+
if (llvm::sys::fs::exists(FullLibName)) {
11063+
SmallString<128> SYCLDeviceLibDir("--device-lib-dir=");
11064+
SYCLDeviceLibDir += DeviceLibLoc.str();
11065+
addArgs(PostLinkArgs, TCArgs, {SYCLDeviceLibDir.str()});
11066+
break;
11067+
}
11068+
}
11069+
}
1105011070
}
1105111071

1105211072
// On Intel targets we don't need non-kernel functions as entry points,
Binary file not shown.

clang/test/Driver/linker-wrapper-libs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ int bar() { return weak; }
161161
// RUN: --linker-path=/usr/bin/ld %t.o %t.a %t.a -o a.out 2>&1 \
162162
// RUN: | FileCheck %s --check-prefix=LIBRARY-GLOBAL-DEFINED
163163

164-
// LIBRARY-GLOBAL-DEFINED: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda -march=sm_70 {{.*}} {{.*}}.o
164+
// LIBRARY-GLOBAL-DEFINED: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda -march=sm_70 {{.*}}.o {{.*}}.o
165165
// LIBRARY-GLOBAL-DEFINED-NOT: {{.*}}gfx1030{{.*}}.o
166166
// LIBRARY-GLOBAL-DEFINED: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx1030 {{.*}}.o {{.*}}.o
167167

@@ -185,7 +185,7 @@ int bar() { return weak; }
185185
// RUN: --linker-path=/usr/bin/ld %t.o --whole-archive %t.a -o a.out 2>&1 \
186186
// RUN: | FileCheck %s --check-prefix=LIBRARY-WHOLE-ARCHIVE
187187

188-
// LIBRARY-WHOLE-ARCHIVE: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda -march=sm_70 {{.*}} {{.*}}.o
188+
// LIBRARY-WHOLE-ARCHIVE: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda -march=sm_70 {{.*}}.o {{.*}}.o
189189
// LIBRARY-WHOLE-ARCHIVE: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx1030 {{.*}}.o {{.*}}.o
190190
// LIBRARY-WHOLE-ARCHIVE: clang{{.*}} -o {{.*}}.img --target=nvptx64-nvidia-cuda -march=sm_52 {{.*}}.o
191191
// LIBRARY-WHOLE-ARCHIVE: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx90a {{.*}}.o

clang/test/Driver/linker-wrapper-sycl-win.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,17 @@
116116
// Error handling when --linker-path is not provided for clang-linker-wrapper
117117
// RUN: not clang-linker-wrapper 2>&1 | FileCheck --check-prefix=LINKER-PATH-NOT-PROVIDED %s
118118
// LINKER-PATH-NOT-PROVIDED: linker path missing, must pass 'linker-path'
119+
120+
/// Check --device-lib-dir for sycl-post-link tool
121+
// ------
122+
// Generate .o file as linker wrapper input.
123+
124+
// RUN: %clang %s -fsycl -fsycl-targets=spir64-unknown-unknown -c --offload-new-driver -o %t5.o
125+
//
126+
// Run clang-linker-wrapper test
127+
//
128+
// RUN: clang-linker-wrapper -sycl-post-link-options="SYCL_POST_LINK_OPTIONS" -llvm-spirv-options="LLVM_SPIRV_OPTIONS" "--host-triple=x86_64-pc-windows-msvc" "--linker-path=/usr/bin/ld" "--" HOST_LINKER_FLAGS "-dynamic-linker" HOST_DYN_LIB "-o" "a.out" HOST_LIB_PATH HOST_STAT_LIB %t5.o -sycl-device-libraries=libsycl-crt.new.o -sycl-device-library-location=%S/Inputs/SYCL/lib --dry-run 2>&1 | FileCheck -check-prefix=CHK-CMDS-DEVICE-LIB-DIR %s
129+
// CHK-CMDS-DEVICE-LIB-DIR: "{{.*}}spirv-to-ir-wrapper.exe" {{.*}} --llvm-spirv-opts --spirv-preserve-auxdata --spirv-target-env=SPV-IR --spirv-builtin-format=global
130+
// CHK-CMDS-DEVICE-LIB-DIR-NEXT: "{{.*}}llvm-link.exe" {{.*}} --suppress-warnings
131+
// CHK-CMDS-DEVICE-LIB-DIR-NEXT: "{{.*}}llvm-link.exe" -only-needed {{.*}} --suppress-warnings
132+
// CHK-CMDS-DEVICE-LIB-DIR-NEXT: "{{.*}}sycl-post-link.exe"{{.*}} --device-lib-dir={{.*}}/Inputs/SYCL/lib {{.*}} SYCL_POST_LINK_OPTIONS {{.*}}

clang/test/Driver/linker-wrapper-sycl.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,15 @@
194194
// Error handling when --linker-path is not provided for clang-linker-wrapper
195195
// RUN: not clang-linker-wrapper 2>&1 | FileCheck --check-prefix=LINKER-PATH-NOT-PROVIDED %s
196196
// LINKER-PATH-NOT-PROVIDED: linker path missing, must pass 'linker-path'
197+
198+
/// check for --device-lib-dir options for sycl-post-link.
199+
// -------
200+
// Generate .o file as linker wrapper input.
201+
//
202+
// RUN: %clang %s -fsycl -fsycl-targets=spir64-unknown-unknown -c --offload-new-driver -o %t5.o
203+
//
204+
// RUN: clang-linker-wrapper -sycl-post-link-options="SYCL_POST_LINK_OPTIONS" -llvm-spirv-options="LLVM_SPIRV_OPTIONS" "--host-triple=x86_64-unknown-linux-gnu" "--linker-path=/usr/bin/ld" "--" HOST_LINKER_FLAGS "-dynamic-linker" HOST_DYN_LIB "-o" "a.out" HOST_LIB_PATH HOST_STAT_LIB %t5.o -sycl-device-libraries=libsycl-crt.new.o -sycl-device-library-location=%S/Inputs/SYCL/lib --dry-run 2>&1 | FileCheck -check-prefix=CHK-CMDS-DEVICE-LIB-DIR %s
205+
// CHK-CMDS-DEVICE-LIB-DIR: "{{.*}}spirv-to-ir-wrapper" {{.*}} --llvm-spirv-opts --spirv-preserve-auxdata --spirv-target-env=SPV-IR --spirv-builtin-format=global
206+
// CHK-CMDS-DEVICE-LIB-DIR-NEXT: "{{.*}}llvm-link" {{.*}} --suppress-warnings
207+
// CHK-CMDS-DEVICE-LIB-DIR-NEXT: "{{.*}}llvm-link" -only-needed {{.*}} --suppress-warnings
208+
// CHK-CMDS-DEVICE-LIB-DIR-NEXT: "{{.*}}sycl-post-link"{{.*}} --device-lib-dir={{.*}}/Inputs/SYCL/lib {{.*}} SYCL_POST_LINK_OPTIONS {{.*}}

clang/test/Driver/linker-wrapper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ __attribute__((visibility("protected"), used)) int x;
4848
// RUN: clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu --dry-run --save-temps -O2 \
4949
// RUN: --linker-path=/usr/bin/ld %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=AMDGPU-LTO-TEMPS
5050

51-
// AMDGPU-LTO-TEMPS: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx1030 -O2 -flto -Wl,--no-undefined {{.*}} -save-temps
51+
// AMDGPU-LTO-TEMPS: clang{{.*}} -o {{.*}}.img --target=amdgcn-amd-amdhsa -mcpu=gfx1030 -O2 -flto -Wl,--no-undefined {{.*}}.o -save-temps
5252

5353
// RUN: clang-offload-packager -o %t.out \
5454
// RUN: --image=file=%t.elf.o,kind=openmp,triple=x86_64-unknown-linux-gnu \

clang/test/Driver/sycl-post-link-options-win.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// REQUIRES: system-windows
22
/// Verify same set of sycl-post-link options generated for old and new offloading model
33
// RUN: %clangxx -### --target=x86_64-pc-windows-msvc -fsycl \
4-
// RUN: -Xdevice-post-link -O0 %s 2>&1 \
4+
// RUN: -Xdevice-post-link -O0 %s --sysroot=%S/Inputs/SYCL 2>&1 \
55
// RUN: | FileCheck -check-prefix OPTIONS_POSTLINK_JIT_OLD %s
6-
// OPTIONS_POSTLINK_JIT_OLD: sycl-post-link{{.*}} "-O2" "-device-globals" "-properties" "-spec-const=native" "-split=auto" "-emit-only-kernels-as-entry-points" "-emit-param-info" "-symbols" "-emit-exported-symbols" "-emit-imported-symbols" "-split-esimd" "-lower-esimd" "-O0"
6+
// OPTIONS_POSTLINK_JIT_OLD: sycl-post-link{{.*}} "-O2" "-device-globals" "--device-lib-dir={{.*}}" "-properties" "-spec-const=native" "-split=auto" "-emit-only-kernels-as-entry-points" "-emit-param-info" "-symbols" "-emit-exported-symbols" "-emit-imported-symbols" "-split-esimd" "-lower-esimd" "-O0"
77
// -------
88
// Generate .o file as linker wrapper input.
99
//

clang/test/Driver/sycl-post-link-options.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// REQUIRES: system-linux
22
/// Verify same set of sycl-post-link options generated for old and new offloading model
33
// RUN: %clangxx --target=x86_64-unknown-linux-gnu -fsycl -### \
4-
// RUN: --no-offload-new-driver -Xdevice-post-link -O0 %s 2>&1 \
4+
// RUN: --no-offload-new-driver -Xdevice-post-link -O0 %s --sysroot=%S/Inputs/SYCL 2>&1 \
55
// RUN: | FileCheck -check-prefix OPTIONS_POSTLINK_JIT_OLD %s
6-
// OPTIONS_POSTLINK_JIT_OLD: sycl-post-link{{.*}} "-O2" "-device-globals" "-properties" "-spec-const=native" "-split=auto" "-emit-only-kernels-as-entry-points" "-emit-param-info" "-symbols" "-emit-exported-symbols" "-emit-imported-symbols" "-split-esimd" "-lower-esimd" "-O0"
6+
// OPTIONS_POSTLINK_JIT_OLD: sycl-post-link{{.*}} "-O2" "-device-globals" "--device-lib-dir={{.*}}" "-properties" "-spec-const=native" "-split=auto" "-emit-only-kernels-as-entry-points" "-emit-param-info" "-symbols" "-emit-exported-symbols" "-emit-imported-symbols" "-split-esimd" "-lower-esimd" "-O0"
77
//
88
// Generate .o file as linker wrapper input.
99
//

0 commit comments

Comments
 (0)