Skip to content

Commit 5ab196d

Browse files
authored
[SYCL][E2E] Clean-up test-modes by removing workarounds (#17023)
- Removes the `build-and-run-mode` feature from e2e lit infrastructure, as well as the remaining `REQUIRES: build-and-run-mode` markups found in tests. - Removes the `run-only` mode ignore line filtering workaround on `REQUIRES: build-and-run-mode`. - Adds `build-mode` to remove `test-mode-run-only` mode, this can be tested for by checking `run-mode && !build-mode`. - Marks CPU aot compilation lines with `%{run-aux}`, as those need to be compiled on a system with the same CPU isa as the running system.
1 parent ef28856 commit 5ab196d

37 files changed

+109
-120
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
image: ${{ matrix.image }}
122122
image_options: ${{ matrix.image_options }}
123123
target_devices: ${{ matrix.target_devices }}
124-
extra_lit_opts: --param fallback-to-build-if-requires-build-and-run=True ${{ matrix.extra_lit_opts }}
124+
extra_lit_opts: ${{ matrix.extra_lit_opts }}
125125
reset_intel_gpu: ${{ matrix.reset_intel_gpu }}
126126
ref: ${{ github.sha }}
127127
sycl_toolchain_artifact: sycl_linux_default

sycl/test-e2e/AOT/cpu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
//===---------------------------------------------------------------------===//
88

99
// REQUIRES: opencl-aot, cpu
10-
// REQUIRES: build-and-run-mode
1110

12-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/aot.cpp -o %t.out
11+
// CPU AOT targets host isa, so we compile on the run system instead.
12+
// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/aot.cpp -o %t.out
1313
// RUN: %{run} %t.out
1414

1515
// Test that opencl-aot can handle multiple build options.

sycl/test-e2e/AOT/double.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
// using fp64 can be compiled AOT.
33

44
// REQUIRES: ocloc, opencl-aot, any-device-is-cpu
5-
// REQUIRES: build-and-run-mode
65
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_tgllp -o %t.tgllp.out %s
7-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s
6+
7+
// CPU AOT targets host isa, so we compile on the run system instead.
8+
// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s
89
// RUN: %if cpu %{ %{run} %t.x86.out %}
910

1011
// ocloc on windows does not have support for PVC, so this command will

sycl/test-e2e/AOT/half.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
// using fp16 can be compiled AOT.
33

44
// REQUIRES: ocloc, opencl-aot, any-device-is-cpu
5-
// REQUIRES: build-and-run-mode
65
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_tgllp -o %t.tgllp.out %s
7-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s
6+
7+
// CPU AOT targets host isa, so we compile on the run system instead.
8+
// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s
89
// RUN: %if cpu %{ %{run} %t.x86.out %}
910

1011
// ocloc on windows does not have support for PVC, so this command will

sycl/test-e2e/Adapters/sycl-targets-order.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
// RUN: %{run-unfiltered-devices} env ONEAPI_DEVICE_SELECTOR="opencl:*" %t-nvptx64-spir64.out
66
// RUN: %{run-unfiltered-devices} env ONEAPI_DEVICE_SELECTOR="cuda:*" %t-nvptx64-spir64.out
77

8-
// REQUIRES: opencl, cuda
9-
// REQUIRES: build-and-run-mode
8+
// REQUIRES: opencl, target-spir, any-triple-is-nvidia
109

1110
//==------- sycl-targets-order.cpp - SYCL -fsycl-targets order test --------==//
1211
//
@@ -36,7 +35,7 @@ int main(int argc, char **argv) {
3635
sycl::buffer<unsigned int, 1> buffer(4);
3736

3837
// size of the index space for the kernel
39-
sycl::range<1> NumOfWorkItems{buffer.get_count()};
38+
sycl::range<1> NumOfWorkItems{buffer.size()};
4039

4140
// submit a command group(work) to the queue
4241
queue.submit([&](sycl::handler &cgh) {
@@ -55,7 +54,7 @@ int main(int argc, char **argv) {
5554

5655
// check the results
5756
bool mismatch = false;
58-
for (unsigned int i = 0; i < buffer.get_count(); ++i) {
57+
for (unsigned int i = 0; i < buffer.size(); ++i) {
5958
if (host_accessor[i] != i) {
6059
std::cout << "The result is incorrect for element: " << i
6160
<< " , expected: " << i << " , got: " << host_accessor[i]
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
// REQUIRES: linux, opencl-aot, cpu
2-
// REQUIRES: build-and-run-mode
32

4-
// RUN: %{build} %device_asan_aot_flags -O0 -g %S/Inputs/host-usm-oob.cpp -o %t.out
3+
// RUN: %{run-aux} %{build} %device_asan_aot_flags -O0 -g %S/Inputs/host-usm-oob.cpp -o %t.out
54
// RUN: %{run} not %t.out 2>&1 | FileCheck %S/Inputs/host-usm-oob.cpp
65

7-
// RUN: %{build} %device_asan_aot_flags -O1 -g %S/Inputs/host-usm-oob.cpp -o %t.out
6+
// RUN: %{run-aux} %{build} %device_asan_aot_flags -O1 -g %S/Inputs/host-usm-oob.cpp -o %t.out
87
// RUN: %{run} not %t.out 2>&1 | FileCheck %S/Inputs/host-usm-oob.cpp
98

10-
// RUN: %{build} %device_asan_aot_flags -O2 -g %S/Inputs/host-usm-oob.cpp -o %t.out
9+
// RUN: %{run-aux} %{build} %device_asan_aot_flags -O2 -g %S/Inputs/host-usm-oob.cpp -o %t.out
1110
// RUN: %{run} not %t.out 2>&1 | FileCheck %S/Inputs/host-usm-oob.cpp
1211

13-
// RUN: %{build} %device_asan_aot_flags -O3 -g %S/Inputs/host-usm-oob.cpp -o %t.out
12+
// RUN: %{run-aux} %{build} %device_asan_aot_flags -O3 -g %S/Inputs/host-usm-oob.cpp -o %t.out
1413
// RUN: %{run} not %t.out 2>&1 | FileCheck %S/Inputs/host-usm-oob.cpp

sycl/test-e2e/AddressSanitizer/aot/gpu.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// REQUIRES: linux, ocloc, gpu && level_zero
2-
// REQUIRES: build-and-run-mode
32

43
// RUN: %{build} %device_asan_aot_flags -O0 -g %S/Inputs/host-usm-oob.cpp -o %t.out
54
// RUN: %{run} not %t.out 2>&1 | FileCheck %S/Inputs/host-usm-oob.cpp

sycl/test-e2e/AddressSanitizer/out-of-bounds/DeviceGlobal/device_global.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// a choice based on that. This is rather fragile but workarounds the issue for
1616
// the time being.
1717

18-
// DEFINE: %{not} = not %if test-mode-run-only %{ --crash %}
18+
// DEFINE: %{not} = not %if run-mode && !build-mode %{ --crash %}
1919

2020
// RUN: %{build} %device_asan_flags -O0 -g -o %t1.out
2121
// RUN: %{run} %{not} %t1.out 2>&1 | FileCheck %s

sycl/test-e2e/BFloat16/bfloat16_example_aot.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
///
55

66
// REQUIRES: opencl-aot, ocloc, gpu-intel-gen12, any-device-is-cpu
7-
// REQUIRES: build-and-run-mode
87

98
// RUN: %clangxx -fsycl -fsycl-targets=spir64 %s -o %t.out
109
// RUN: %{run} %t.out
1110

1211
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_gen -Xsycl-target-backend=spir64_gen "-device gen12lp" %s -o %t.out
1312
// RUN: %{run} %t.out
1413

15-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen "-device gen12lp" %s -o %t.out
14+
// CPU AOT targets host isa, so we compile on the run system instead.
15+
// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen "-device gen12lp" %s -o %t.out
1616
// RUN: %{run} %t.out
1717

1818
#include "bfloat16_example.hpp"

sycl/test-e2e/BFloat16/bfloat16_example_aot_cpu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
///
55

66
// REQUIRES: opencl-aot, ocloc, gpu-intel-gen12, any-device-is-cpu
7-
// REQUIRES: build-and-run-mode
87

98
// RUN: %clangxx -fsycl -fsycl-targets=spir64,spir64_gen -Xsycl-target-backend=spir64_gen "-device dg1" %s -o %t.out
109
// RUN: %if cpu %{ %{run} %t.out %}
1110

12-
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen "-device dg1" %s -o %t.out
11+
// CPU AOT targets host isa, so we compile on the run system instead.
12+
// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen "-device dg1" %s -o %t.out
1313
// RUN: %if cpu %{ %{run} %t.out %}
1414

1515
#include "bfloat16_example.hpp"

0 commit comments

Comments
 (0)