Skip to content

Commit d607380

Browse files
[SYCL][CI] Run entire E2E suite in preview mode in Nightly (#17073)
1 parent 312725f commit d607380

21 files changed

+67
-46
lines changed

.github/workflows/sycl-nightly.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ jobs:
108108
runner: '["Linux", "arc"]'
109109
image_options: -u 1001
110110
target_devices: opencl:cpu
111+
112+
- name: Preview mode on SPR/PVC
113+
runner: '["Linux", "pvc"]'
114+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
115+
target_devices: level_zero:gpu
116+
extra_lit_opts: --param test-preview-mode=True
117+
111118
uses: ./.github/workflows/sycl-linux-run-tests.yml
112119
with:
113120
name: ${{ matrix.name }}

sycl/test-e2e/Basic/backend_info.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// UNSUPPORTED: preview-mode
2+
// UNSUPPORTED-INTENDED: Functionality is removed under
3+
// `-fpreview-breaking-changes`
14
// RUN: %{build} -o %t.out -Wno-deprecated-declarations
25
// RUN: %{run} %t.out
36
//

sycl/test-e2e/Config/kernel_from_file.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// RUN: %if linux %{ llvm-link -o=%t_app.bc %t.bc %t_compiler_wrappers.bc %t_asan.bc %} %else %{ llvm-link -o=%t_app.bc %t.bc %t_compiler_wrappers.bc %}
1515
// >> ---- translate to SPIR-V
1616
// RUN: llvm-spirv -o %t.spv %t_app.bc
17-
// RUN: %clangxx -Wno-error=ignored-attributes %sycl_include -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option %t.h %s -o %t.out %sycl_options -Xclang -verify-ignore-unexpected=note,warning
17+
// RUN: %clangxx -Wno-error=ignored-attributes %sycl_include -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option %t.h %s -o %t.out %sycl_options -Xclang -verify-ignore-unexpected=note,warning %if preview-mode %{-Wno-unused-command-line-argument%}
1818
// RUN: env SYCL_USE_KERNEL_SPV=%t.spv %{run} %t.out | FileCheck %s
1919
// CHECK: Passed
2020

sycl/test-e2e/E2EExpr.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
class E2EExpr(BooleanExpression):
55
build_specific_features = {
66
"build-and-run-mode",
7+
"preview-mode",
78
"target-spir",
89
"target-nvidia",
910
"target-amd",

sycl/test-e2e/IntermediateLib/dynamic_app_linux.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %clangxx -fsycl -fPIC -shared -o %T/simple_lib.so %S/Inputs/simple_lib.cpp
55

66
// build app
7-
// RUN: %clangxx -DSO_PATH="%T/simple_lib.so" -o %t.out %s
7+
// RUN: %clangxx -DSO_PATH="%T/simple_lib.so" -o %t.out %s %if preview-mode %{-Wno-unused-command-line-argument%}
88

99
// RUN: %{run} %t.out
1010
// RUN: env UR_L0_LEAKS_DEBUG=1 %{run} %t.out
@@ -65,4 +65,4 @@ int main() {
6565
assert(result == 7);
6666

6767
return 0;
68-
}
68+
}

sycl/test-e2e/SeparateCompile/test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
// RUN: clang-offload-wrapper -o wrapper.bc -host=x86_64 -kind=sycl -target=spir64 -batch test_spv.table
4949
//
5050
// >> compile .bc to .o
51-
// RUN: %clangxx -Wno-error=override-module -c wrapper.bc -o wrapper.o
51+
// RUN: %clangxx -Wno-error=override-module -c wrapper.bc -o wrapper.o %if preview-mode %{-Wno-unused-command-line-argument%}
5252
//
5353
// >> ---- link the full hetero app
5454
// RUN: %clangxx wrapper.o a.o b.o -Wno-unused-command-line-argument -o app.exe %sycl_options

sycl/test-e2e/XPTI/basic_event_collection_linux.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// REQUIRES: xptifw, opencl, cpu, linux
2-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib -shared -fPIC -std=c++17 -o %t_collector.so
2+
// RUN: %build_collector
33
// RUN: %{build} -o %t.out
4-
// RUN: env UR_ENABLE_LAYERS=UR_LAYER_TRACING env XPTI_TRACE_ENABLE=1 env XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher env XPTI_SUBSCRIBERS=%t_collector.so %{run} %t.out | FileCheck %s
4+
// RUN: env UR_ENABLE_LAYERS=UR_LAYER_TRACING env XPTI_TRACE_ENABLE=1 env XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher env XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s
55

66
#include "basic_event_collection.inc"
77
//

sycl/test-e2e/XPTI/buffer/accessors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: xptifw, opencl
2-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
2+
// RUN: %build_collector
33
// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out
44
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s
55

sycl/test-e2e/XPTI/buffer/host_array.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: xptifw, opencl
2-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
2+
// RUN: %build_collector
33
// RUN: %{build} -o %t.out
44
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s
55

sycl/test-e2e/XPTI/buffer/in_cycle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: xptifw, opencl
2-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
2+
// RUN: %build_collector
33
// RUN: %{build} -o %t.out
44
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s
55

sycl/test-e2e/XPTI/buffer/multiple_buffers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: xptifw, opencl
2-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
2+
// RUN: %build_collector
33
// RUN: %{build} -o %t.out
44
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s
55

sycl/test-e2e/XPTI/buffer/multiple_queues.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: xptifw, opencl, (cpu || accelerator)
2-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
2+
// RUN: %build_collector
33
// RUN: %{build} -o %t.out
44
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s
55

sycl/test-e2e/XPTI/buffer/recursion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: xptifw, opencl
2-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
2+
// RUN: %build_collector
33
// RUN: %{build} -o %t.out
44
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s
55

sycl/test-e2e/XPTI/buffer/sub_buffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: xptifw, opencl
2-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
2+
// RUN: %build_collector
33
// RUN: %{build} -o %t.out
44
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s
55

sycl/test-e2e/XPTI/buffer/use_host_ptr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: xptifw, opencl
2-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
2+
// RUN: %build_collector
33
// RUN: %{build} -o %t.out
44
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s
55

sycl/test-e2e/XPTI/image/accessors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: xptifw, opencl
22
// REQUIRES: aspect-ext_intel_legacy_image
3-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
3+
// RUN: %build_collector
44
// RUN: %{build} -o %t.out
55
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s
66

sycl/test-e2e/XPTI/kernel/basic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: xptifw, opencl, target-spir
2-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
2+
// RUN: %build_collector
33
// RUN: %{build} -O2 -o %t.opt.out
44
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.opt.out | FileCheck %s --check-prefixes=CHECK,CHECK-OPT
55
// RUN: %{build} -fno-sycl-dead-args-optimization -o %t.noopt.out

sycl/test-e2e/XPTI/kernel/content.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REQUIRES: xptifw, opencl, target-spir
2-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
2+
// RUN: %build_collector
33
// RUN: %{build} -Wno-error=deprecated-declarations -O2 -o %t.opt.out
44
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.opt.out | FileCheck %s --check-prefix=CHECK-OPT
55
// RUN: %{build} -Wno-error=deprecated-declarations -fno-sycl-dead-args-optimization -o %t.noopt.out

sycl/test-e2e/XPTI/lit.local.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Prepending instead of appending so that `%shared_lib` is expanded before `%s`.
2+
config.substitutions.insert(0, ("%build_collector", "%clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll %if preview-mode %{-Wno-unused-command-line-argument%}"))

sycl/test-e2e/XPTI/mem_alloc_events_linux.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// REQUIRES: xptifw, level_zero, gpu, linux
2-
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib -shared -fPIC -std=c++17 -o %t_collector.so
2+
// RUN: %build_collector
33
// RUN: %{build} -o %t.out
4-
// RUN: env XPTI_TRACE_ENABLE=1 env XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher env XPTI_SUBSCRIBERS=%t_collector.so %{run} %t.out | FileCheck %s
4+
// RUN: env XPTI_TRACE_ENABLE=1 env XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher env XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s
55

66
#include "mem_alloc_events.inc"
77

sycl/test-e2e/lit.cfg.py

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -330,29 +330,32 @@ def open_check_file(file_name):
330330
else:
331331
config.substitutions.append(("%level_zero_options", ""))
332332

333-
# Check for sycl-preview library
334-
check_preview_breaking_changes_file = "preview_breaking_changes_link.cpp"
335-
with open_check_file(check_preview_breaking_changes_file) as fp:
336-
print(
337-
textwrap.dedent(
333+
if lit_config.params.get("test-preview-mode", False):
334+
config.available_features.add("preview-mode")
335+
else:
336+
# Check for sycl-preview library
337+
check_preview_breaking_changes_file = "preview_breaking_changes_link.cpp"
338+
with open_check_file(check_preview_breaking_changes_file) as fp:
339+
print(
340+
textwrap.dedent(
341+
"""
342+
#include <sycl/sycl.hpp>
343+
namespace sycl { inline namespace _V1 { namespace detail {
344+
extern void PreviewMajorReleaseMarker();
345+
}}}
346+
int main() { sycl::detail::PreviewMajorReleaseMarker(); return 0; }
338347
"""
339-
#include <sycl/sycl.hpp>
340-
namespace sycl { inline namespace _V1 { namespace detail {
341-
extern void PreviewMajorReleaseMarker();
342-
}}}
343-
int main() { sycl::detail::PreviewMajorReleaseMarker(); return 0; }
344-
"""
345-
),
346-
file=fp,
347-
)
348+
),
349+
file=fp,
350+
)
348351

349-
sp = subprocess.getstatusoutput(
350-
config.dpcpp_compiler
351-
+ " -fsycl -fpreview-breaking-changes "
352-
+ check_preview_breaking_changes_file
353-
)
354-
if sp[0] == 0:
355-
config.available_features.add("preview-breaking-changes-supported")
352+
sp = subprocess.getstatusoutput(
353+
config.dpcpp_compiler
354+
+ " -fsycl -fpreview-breaking-changes "
355+
+ check_preview_breaking_changes_file
356+
)
357+
if sp[0] == 0:
358+
config.available_features.add("preview-breaking-changes-supported")
356359

357360
# Check if clang is built with ZSTD and compression support.
358361
fPIC_opt = "-fPIC" if platform.system() != "Windows" else ""
@@ -890,12 +893,17 @@ def open_check_file(file_name):
890893
config.substitutions.append(("%clangxx", " true "))
891894
config.substitutions.append(("%clang", " true "))
892895
else:
893-
config.substitutions.append(
894-
("%clangxx", " " + config.dpcpp_compiler + " " + config.cxx_flags)
895-
)
896-
config.substitutions.append(
897-
("%clang", " " + config.dpcpp_compiler + " " + config.c_flags)
898-
)
896+
clangxx = " " + config.dpcpp_compiler + " "
897+
if "preview-mode" in config.available_features:
898+
# Technically, `-fpreview-breaking-changes` is reported as unused option
899+
# if used without `-fsycl`. However, we have far less tests compiling
900+
# pure C++ (without `-fsycl`) than we have tests doing `%clangxx -fsycl`
901+
# and not relying on simple `%{build}`. As such, it's easier and less
902+
# error prone to silence the warning in those instances than to risk not
903+
# running some tests properly in the `test-preview-mode`.
904+
clangxx += "-fpreview-breaking-changes "
905+
clangxx += config.cxx_flags
906+
config.substitutions.append(("%clangxx", clangxx))
899907

900908
if lit_config.params.get("print_features", False):
901909
lit_config.note(

0 commit comments

Comments
 (0)