Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sycl/test-e2e/Assert/assert_in_kernels_ndebug.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} -DNDEBUG %S/assert_in_kernels.cpp -o %t.out
// RUN: %clangxx -fsycl %{sycl_target_opts} -DNDEBUG %S/assert_in_kernels.cpp -o %t.out
// RUN: %{run} %t.out | FileCheck %s
//
// CHECK-NOT: One shouldn't see this message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// XFAIL: (opencl && gpu)
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/11364

// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%{sycl_triple} -DDEFINE_NDEBUG_INFILE2 -I %S/Inputs %S/assert_in_multiple_tus.cpp %S/Inputs/kernels_in_file2.cpp -o %t.out
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl %{sycl_target_opts} -DDEFINE_NDEBUG_INFILE2 -I %S/Inputs %S/assert_in_multiple_tus.cpp %S/Inputs/kernels_in_file2.cpp -o %t.out
// Shouldn't fail on ACC as fallback assert isn't enqueued there
// RUN: %{run} %t.out &> %t.txt ; FileCheck %s --input-file %t.txt %if fpga %{ --check-prefix=CHECK-ACC %}
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: windows
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%{sycl_triple} -DDEFINE_NDEBUG_INFILE2 -I %S/Inputs %S/assert_in_multiple_tus.cpp %S/Inputs/kernels_in_file2.cpp -o %t.out
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl %{sycl_target_opts} -DDEFINE_NDEBUG_INFILE2 -I %S/Inputs %S/assert_in_multiple_tus.cpp %S/Inputs/kernels_in_file2.cpp -o %t.out
// Shouldn't fail on ACC as fallback assert isn't enqueued there
// RUN: %{run} %t.out &> %t.txt ; FileCheck %s --input-file %t.txt %if fpga %{ --check-prefix=CHECK-ACC %}
//
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Assert/assert_in_one_kernel_ndebug.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} -DNDEBUG %S/assert_in_one_kernel.cpp -o %t.out
// RUN: %clangxx -fsycl %{sycl_target_opts} -DNDEBUG %S/assert_in_one_kernel.cpp -o %t.out
// RUN: %{run} %t.out | FileCheck %s
//
// CHECK-NOT: from assert statement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// XFAIL: (opencl && gpu)
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/11364
//
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl -fsycl-targets=%{sycl_triple} -DDEFINE_NDEBUG_INFILE2 -I %S/Inputs %S/assert_in_simultaneously_multiple_tus.cpp %S/Inputs/kernels_in_file2.cpp -o %t.out %threads_lib
// RUN: %clangxx -DSYCL_FALLBACK_ASSERT=1 -fsycl %{sycl_target_opts} -DDEFINE_NDEBUG_INFILE2 -I %S/Inputs %S/assert_in_simultaneously_multiple_tus.cpp %S/Inputs/kernels_in_file2.cpp -o %t.out %threads_lib
// RUN: %if cpu %{ %{run} %t.out &> %t.cpu.txt ; FileCheck %s --input-file %t.cpu.txt %}
//
// Since this is a multi-threaded application enable memory tracking and
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/BFloat16/bfloat16_builtins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// + below sm_80 always uses generic impls

// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_80 %} %s -o %t.out %{mathflags}
// RUN: %clangxx -fsycl %{sycl_target_opts} %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_80 %} %s -o %t.out %{mathflags}
// RUN: %{run} %t.out

// Test "new" (ABI breaking) for all platforms ( sm_80/native if CUDA )
// RUN: %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes -fsycl-targets=%{sycl_triple} %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_80 %} %s -o %t2.out %{mathflags} %}
// RUN: %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes %{sycl_target_opts} %if any-device-is-cuda %{ -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_80 %} %s -o %t2.out %{mathflags} %}
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}

#include "bfloat16_builtins.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// DEFINE: %{mathflags} = %if cl_options %{/clang:-fno-fast-math%} %else %{-fno-fast-math%}

// If CUDA, test "new" again for sm_75/generic
// RUN: %if any-device-is-cuda %{ %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes -fsycl-targets=%{sycl_triple} -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_75 %s -o %t3.out %{mathflags} %} %}
// RUN: %if any-device-is-cuda %{ %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes %{sycl_target_opts} -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_75 %s -o %t3.out %{mathflags} %} %}
// RUN: %if any-device-is-cuda %{ %if preview-breaking-changes-supported %{ %{run} %t3.out %} %}

#include "bfloat16_builtins.hpp"
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Basic/multisource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
// Separate kernel sources and host code sources
// RUN: %{build} -c -o %t.kernel.o -DINIT_KERNEL -DCALC_KERNEL
// RUN: %{build} -c -o %t.main.o -DMAIN_APP
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.kernel.o %t.main.o -Wno-unused-command-line-argument -o %t1.fat
// RUN: %clangxx -fsycl %{sycl_target_opts} %t.kernel.o %t.main.o -Wno-unused-command-line-argument -o %t1.fat
// RUN: %{run} %t1.fat

// Multiple sources with kernel code
// RUN: %{build} -c -o %t.init.o -DINIT_KERNEL
// RUN: %{build} -c -o %t.calc.o -DCALC_KERNEL
// RUN: %{build} -c -o %t.main.o -DMAIN_APP
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.init.o %t.calc.o %t.main.o -Wno-unused-command-line-argument -o %t2.fat
// RUN: %clangxx -fsycl %{sycl_target_opts} %t.init.o %t.calc.o %t.main.o -Wno-unused-command-line-argument -o %t2.fat
// RUN: %{run} %t2.fat

#include <sycl/detail/core.hpp>
Expand Down
6 changes: 3 additions & 3 deletions sycl/test-e2e/Basic/multisource_spv_obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
// Separate kernel sources and host code sources
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.kernel.o -DINIT_KERNEL -DCALC_KERNEL
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.main.o -DMAIN_APP
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.kernel.o %t.main.o -Wno-unused-command-line-argument -o %t1.fat
// RUN: %clangxx -fsycl %{sycl_target_opts} %t.kernel.o %t.main.o -Wno-unused-command-line-argument -o %t1.fat
// RUN: %{run} %t1.fat

// Multiple sources with kernel code
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.init.o -DINIT_KERNEL
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.calc.o -DCALC_KERNEL
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.main.o -DMAIN_APP
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.init.o %t.calc.o %t.main.o -Wno-unused-command-line-argument -o %t2.fat
// RUN: %clangxx -fsycl %{sycl_target_opts} %t.init.o %t.calc.o %t.main.o -Wno-unused-command-line-argument -o %t2.fat
// RUN: %{run} %t2.fat

// Multiple sources with kernel code, mixed SPIR-V and LLVM-IR objects
// RUN: %{build} -fsycl-device-obj=spirv -c -o %t.init.o -DINIT_KERNEL
// RUN: %{build} -fsycl-device-obj=llvmir -c -o %t.calc.o -DCALC_KERNEL
// RUN: %{build} -c -o %t.main.o -DMAIN_APP
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.init.o %t.calc.o %t.main.o -Wno-unused-command-line-argument -o %t3.fat
// RUN: %clangxx -fsycl %{sycl_target_opts} %t.init.o %t.calc.o %t.main.o -Wno-unused-command-line-argument -o %t3.fat
// RUN: %{run} %t3.fat

#include <sycl/detail/core.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/DeviceImageDependencies/dynamic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// RUN: %clangxx %{dynamic_lib_options} %S/Inputs/b.cpp %if windows %{%T/libdevice_c.lib%} -o %T/libdevice_b.%{dynamic_lib_suffix}
// RUN: %clangxx %{dynamic_lib_options} %S/Inputs/a.cpp %if windows %{%T/libdevice_b.lib%} -o %T/libdevice_a.%{dynamic_lib_suffix}

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} -fsycl-allow-device-image-dependencies -fsycl-device-code-split=per_kernel %S/Inputs/basic.cpp -o %t.out \
// RUN: %clangxx -fsycl %{sycl_target_opts} -fsycl-allow-device-image-dependencies -fsycl-device-code-split=per_kernel %S/Inputs/basic.cpp -o %t.out \
// RUN: %if windows \
// RUN: %{%T/libdevice_a.lib%} \
// RUN: %else \
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/DeviceImageDependencies/objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
// RUN: %clangxx -fsycl %S/Inputs/b.cpp -I %S/Inputs -c -o %t_b.o
// RUN: %clangxx -fsycl %S/Inputs/c.cpp -I %S/Inputs -c -o %t_c.o
// RUN: %clangxx -fsycl %S/Inputs/d.cpp -I %S/Inputs -c -o %t_d.o
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} -fsycl-device-code-split=per_kernel -fsycl-allow-device-image-dependencies %t_a.o %t_b.o %t_c.o %t_d.o %S/Inputs/basic.cpp -o %t.out
// RUN: %clangxx -fsycl %{sycl_target_opts} -fsycl-device-code-split=per_kernel -fsycl-allow-device-image-dependencies %t_a.o %t_b.o %t_c.o %t_d.o %S/Inputs/basic.cpp -o %t.out
// RUN: %{run} %t.out
8 changes: 4 additions & 4 deletions sycl/test-e2e/NewOffloadDriver/multisource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
// Test with `--offload-new-driver`
// RUN: %{build} --offload-new-driver -c -o %t.kernel.o -DINIT_KERNEL -DCALC_KERNEL
// RUN: %{build} --offload-new-driver -c -o %t.main.o -DMAIN_APP
// RUN: %clangxx -Wno-error=unused-command-line-argument -fsycl -fsycl-targets=%{sycl_triple} --offload-new-driver %t.kernel.o %t.main.o -o %t1.fat
// RUN: %clangxx -Wno-error=unused-command-line-argument -fsycl %{sycl_target_opts} --offload-new-driver %t.kernel.o %t.main.o -o %t1.fat
// RUN: %{run} %t1.fat

// Multiple sources with kernel code
// Test with `--offload-new-driver`
// RUN: %{build} --offload-new-driver -c -o %t.init.o -DINIT_KERNEL
// RUN: %{build} --offload-new-driver -c -o %t.calc.o -DCALC_KERNEL
// RUN: %{build} --offload-new-driver -c -o %t.main.o -DMAIN_APP
// RUN: %clangxx -Wno-error=unused-command-line-argument -fsycl -fsycl-targets=%{sycl_triple} --offload-new-driver %t.init.o %t.calc.o %t.main.o -o %t2.fat
// RUN: %clangxx -Wno-error=unused-command-line-argument -fsycl %{sycl_target_opts} --offload-new-driver %t.init.o %t.calc.o %t.main.o -o %t2.fat
// RUN: %{run} %t2.fat

// Multiple sources with kernel code with old-style objects
// Test with `--offload-new-driver`
// RUN: %{build} --no-offload-new-driver -c -o %t.init.o -DINIT_KERNEL
// RUN: %{build} --no-offload-new-driver -c -o %t.calc.o -DCALC_KERNEL
// RUN: %{build} --no-offload-new-driver -c -o %t.main.o -DMAIN_APP
// RUN: %clangxx -Wno-error=unused-command-line-argument -fsycl -fsycl-targets=%{sycl_triple} --offload-new-driver %t.init.o %t.calc.o %t.main.o -o %t3.fat
// RUN: %clangxx -Wno-error=unused-command-line-argument -fsycl %{sycl_target_opts} --offload-new-driver %t.init.o %t.calc.o %t.main.o -o %t3.fat
// RUN: %{run} %t3.fat

// Multiple sources with kernel code with old-style objects in a static archive
Expand All @@ -36,7 +36,7 @@
// RUN: %{build} --no-offload-new-driver -c -o %t.calc.o -DCALC_KERNEL
// RUN: %{build} --no-offload-new-driver -c -o %t.main.o -DMAIN_APP
// RUN: llvm-ar r %t.a %t.init.o %t.calc.o
// RUN: %clangxx -Wno-error=unused-command-line-argument -fsycl -fsycl-targets=%{sycl_triple} --offload-new-driver %t.main.o %t.a -o %t4.fat
// RUN: %clangxx -Wno-error=unused-command-line-argument -fsycl %{sycl_target_opts} --offload-new-driver %t.main.o %t.a -o %t4.fat
// RUN: %{run} %t4.fat

#include <sycl/detail/core.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Test with `--offload-new-driver`
// RUN: %{build} -DSOURCE1 --offload-new-driver -c -o %t1.o
// RUN: %{build} -DSOURCE2 --offload-new-driver -c -o %t2.o
// RUN: %clangxx -Wno-error=unused-command-line-argument -fsycl -fsycl-targets=%{sycl_triple} --offload-new-driver %t1.o %t2.o -o %t.exe
// RUN: %clangxx -Wno-error=unused-command-line-argument -fsycl %{sycl_target_opts} --offload-new-driver %t1.o %t2.o -o %t.exe
// RUN: %{run} %t.exe
// XFAIL: cuda
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/16413
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/OneapiDeviceSelector/illegal_input.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %S/Inputs/trivial.cpp -o %t.out
// RUN: %clangxx -fsycl %{sycl_target_opts} %S/Inputs/trivial.cpp -o %t.out
// RUN: not --crash env ONEAPI_DEVICE_SELECTOR="macaroni:*" %{run-unfiltered-devices} %t.out
// RUN: not --crash env ONEAPI_DEVICE_SELECTOR=":" %{run-unfiltered-devices} %t.out
// RUN: not --crash env ONEAPI_DEVICE_SELECTOR="level_zero:." %{run-unfiltered-devices} %t.out
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %{build} -DSOURCE1 -c -o %t1.o
// RUN: %{build} -DSOURCE2 -c -o %t2.o
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t1.o %t2.o -Wno-unused-command-line-argument -o %t.exe
// RUN: %clangxx -fsycl %{sycl_target_opts} %t1.o %t2.o -Wno-unused-command-line-argument -o %t.exe
// RUN: %{run} %t.exe

#ifdef SOURCE1
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ is substituted with just `[Optional run_launcher if that is configured]`.
Another little nuance is `%{sycl_triple}` substitution. It is constructed by
concatenating triples for all the devices from `sycl_devices` supported by a
given test. After that there is also a convenient `%{build}` substitution that
is equivalent to `%clangxx -fsycl -fsycl-targets=%{sycl_triple} %s`.
is equivalent to `%clangxx -fsycl %{sycl_target_opts} %s`.

## Prerequisites

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Regression/DAE-separate-compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// The test checks that the scenario works correctly.
//
// RUN: %{build} -O2 -c -o %t.o
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t.o %O0 -Wno-unused-command-line-argument -o %t.out
// RUN: %clangxx -fsycl %{sycl_target_opts} %t.o %O0 -Wno-unused-command-line-argument -o %t.out
// RUN: %{run} %t.out

// Failing on HIP AMD, enable after fixed
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Regression/commandlist/gpu.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// REQUIRES: gpu

// RUN: %clangxx -Wno-error=vla-cxx-extension -fsycl -fsycl-targets=%{sycl_triple} %S/Inputs/FindPrimesSYCL.cpp %S/Inputs/main.cpp -o %t.out %threads_lib
// RUN: %clangxx -Wno-error=vla-cxx-extension -fsycl %{sycl_target_opts} %S/Inputs/FindPrimesSYCL.cpp %S/Inputs/main.cpp -o %t.out %threads_lib
// RUN: %{run} %t.out
8 changes: 4 additions & 4 deletions sycl/test-e2e/Regression/multiple-targets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
//
// REQUIRES: cuda || hip || native_cpu
// REQUIRES: build-and-run-mode
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple},spir64 -o %t1.out %s
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple},spir64 %if any-device-is-hip %{ %{hip_arch_opts} %} -o %t1.out %s
// RUN: %{run} %t1.out
//
// RUN: %clangxx -fsycl -fsycl-targets=spir64,%{sycl_triple} -o %t2.out %s
// RUN: %clangxx -fsycl -fsycl-targets=spir64,%{sycl_triple} %if any-device-is-hip %{ %{hip_arch_opts} %} -o %t2.out %s
// RUN: %{run} %t2.out
//
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple},spir64 -fsycl-device-code-split=per_kernel -o %t3.out %s
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple},spir64 %if any-device-is-hip %{ %{hip_arch_opts} %} -fsycl-device-code-split=per_kernel -o %t3.out %s
// RUN: %{run} %t3.out
//
// RUN: %clangxx -fsycl -fsycl-targets=spir64,%{sycl_triple} -fsycl-device-code-split=per_kernel -o %t4.out %s
// RUN: %clangxx -fsycl -fsycl-targets=spir64,%{sycl_triple} %if any-device-is-hip %{ %{hip_arch_opts} %} -fsycl-device-code-split=per_kernel -o %t4.out %s
// RUN: %{run} %t4.out

#include <sycl/detail/core.hpp>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/SeparateCompile/same-kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// RUN: %{build} -DB_CPP=1 -c -o %t-same-kernel-b.o
//
// >> ---- link the full hetero app
// RUN: %clangxx %t-same-kernel-a.o %t-same-kernel-b.o -Wno-unused-command-line-argument -o %t-same-kernel.exe -fsycl -fsycl-targets=%{sycl_triple}
// RUN: %clangxx -fsycl %{sycl_target_opts} %t-same-kernel-a.o %t-same-kernel-b.o -Wno-unused-command-line-argument -o %t-same-kernel.exe
// RUN: %{run} %t-same-kernel.exe

#include <sycl/detail/core.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
// RUN: %{build} -O3 -DSOURCE3 -c -o %t3.o
// RUN: rm -f %t.a
// RUN: llvm-ar crv %t.a %t1.o %t2.o
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} -O3 %t3.o %t.a -Wno-unused-command-line-argument -o %t1.exe
// RUN: %clangxx -fsycl %{sycl_target_opts} -O3 %t3.o %t.a -Wno-unused-command-line-argument -o %t1.exe
// RUN: %{run} %t1.exe

// Check the repacked case as it can behave differently.
// RUN: echo create %t_repacked.a > %t.txt
// RUN: echo addlib %t.a >> %t.txt
// RUN: echo save >> %t.txt
// RUN: cat %t.txt | llvm-ar -M
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} -O3 %t3.o %t_repacked.a -Wno-unused-command-line-argument -o %t2.exe
// RUN: %clangxx -fsycl %{sycl_target_opts} -O3 %t3.o %t_repacked.a -Wno-unused-command-line-argument -o %t2.exe
// RUN: %{run} %t2.exe

#include <iostream>
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/SeparateCompile/sycl-external.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
// different object file.
// RUN: %{build} -DSOURCE1 -c -o %t1.o
// RUN: %{build} -DSOURCE2 -c -o %t2.o
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t1.o %t2.o -Wno-unused-command-line-argument -o %t1.exe
// RUN: %clangxx -fsycl %{sycl_target_opts} %t1.o %t2.o -Wno-unused-command-line-argument -o %t1.exe
// RUN: %{run} %t1.exe
//
// Test2 - check that kernel can call a SYCL_EXTERNAL function defined in a
// static library.
// RUN: rm -f %t.a
// RUN: llvm-ar crv %t.a %t1.o
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %t2.o %t.a -Wno-unused-command-line-argument -o %t2.exe
// RUN: %clangxx -fsycl %{sycl_target_opts} %t2.o %t.a -Wno-unused-command-line-argument -o %t2.exe
// RUN: %{run} %t2.exe

#include <iostream>
Expand Down
22 changes: 16 additions & 6 deletions sycl/test-e2e/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import re


def get_triple(test, backend):
def get_triple(backend):
if backend == "cuda":
return "nvptx64-nvidia-cuda"
if backend == "hip":
Expand Down Expand Up @@ -168,17 +168,27 @@ def execute(self, test, litConfig):

for sycl_device in devices_for_test:
(backend, _) = sycl_device.split(":")
triples.add(get_triple(test, backend))
triples.add(get_triple(backend))

substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir, tmpBase)

substitutions.append(("%{sycl_triple}", format(",".join(triples))))
# -fsycl-targets is needed for CUDA/HIP, so just use it be default so
# -that new tests by default would runnable there (unless they have
# -other restrictions).

sycl_target_opts = "-fsycl-targets=%{sycl_triple}"
if get_triple("hip") in triples:
hip_arch_opts = (
" -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch={}".format(
test.config.amd_arch
)
)
sycl_target_opts += hip_arch_opts
substitutions.append(("%{hip_arch_opts}", hip_arch_opts))
substitutions.append(("%{sycl_target_opts}", sycl_target_opts))

substitutions.append(
(
"%{build}",
"%clangxx -fsycl -fsycl-targets=%{sycl_triple} %verbose_print %s",
"%clangxx -fsycl %{sycl_target_opts} %verbose_print %s",
)
)
if platform.system() == "Windows":
Expand Down
10 changes: 1 addition & 9 deletions sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,6 @@ def open_check_file(file_name):
# discovered already.
config.sycl_dev_features = {}

# Architecture flag for compiling for AMD HIP devices. Empty otherwise.
arch_flag = ""
# Version of the driver for a given device. Empty for non-Intel devices.
config.intel_driver_ver = {}
for sycl_device in config.sycl_devices:
Expand Down Expand Up @@ -838,9 +836,6 @@ def open_check_file(file_name):
)
config.amd_arch = arch.replace(amd_arch_prefix, "")
llvm_config.with_system_environment("ROCM_PATH")
arch_flag = (
"-Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=" + config.amd_arch
)
config.substitutions.append(
("%rocm_path", os.environ.get("ROCM_PATH", "/opt/rocm"))
)
Expand All @@ -856,10 +851,7 @@ def open_check_file(file_name):
config.substitutions.append(("%clang", " true "))
else:
config.substitutions.append(
(
"%clangxx",
" " + config.dpcpp_compiler + " " + config.cxx_flags + " " + arch_flag,
)
("%clangxx", " " + config.dpcpp_compiler + " " + config.cxx_flags)
)
config.substitutions.append(
("%clang", " " + config.dpcpp_compiler + " " + config.c_flags)
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/syclcompat/kernel/kernel_lin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
// TODO: Supported for ROCM 5. Further development required to support AMDGPU.
// UNSUPPORTED: hip

// RUN: %clangxx -fPIC -shared -fsycl -fsycl-targets=%{sycl_triple} %S/Inputs/kernel_module.cpp -o %t.so
// RUN: %clangxx -DTEST_SHARED_LIB='"%t.so"' -ldl -fsycl -fsycl-targets=%{sycl_triple} %S/Inputs/kernel_function.cpp -o %t.out
// RUN: %clangxx -fPIC -shared -fsycl %{sycl_target_opts} %S/Inputs/kernel_module.cpp -o %t.so
// RUN: %clangxx -DTEST_SHARED_LIB='"%t.so"' -ldl -fsycl %{sycl_target_opts} %S/Inputs/kernel_function.cpp -o %t.out
// RUN: %{run} %t.out
Loading
Loading