Skip to content

[SYCL][CI] Run entire E2E suite in preview mode in Nightly #17073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 20, 2025
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
7 changes: 7 additions & 0 deletions .github/workflows/sycl-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ jobs:
runner: '["Linux", "arc"]'
image_options: -u 1001
target_devices: opencl:cpu

- name: Preview mode on SPR/PVC
runner: '["Linux", "pvc"]'
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
target_devices: level_zero:gpu
extra_lit_opts: --param test-preview-mode=True

uses: ./.github/workflows/sycl-linux-run-tests.yml
with:
name: ${{ matrix.name }}
Expand Down
3 changes: 3 additions & 0 deletions sycl/test-e2e/Basic/backend_info.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// UNSUPPORTED: preview-mode
// UNSUPPORTED-INTENDED: Functionality is removed under
// `-fpreview-breaking-changes`
// RUN: %{build} -o %t.out -Wno-deprecated-declarations
// RUN: %{run} %t.out
//
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Config/kernel_from_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// 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 %}
// >> ---- translate to SPIR-V
// RUN: llvm-spirv -o %t.spv %t_app.bc
// 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
// 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%}
// RUN: env SYCL_USE_KERNEL_SPV=%t.spv %{run} %t.out | FileCheck %s
// CHECK: Passed

Expand Down
1 change: 1 addition & 0 deletions sycl/test-e2e/E2EExpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
class E2EExpr(BooleanExpression):
build_specific_features = {
"build-and-run-mode",
"preview-mode",
"target-spir",
"target-nvidia",
"target-amd",
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/IntermediateLib/dynamic_app_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// RUN: %clangxx -fsycl -fPIC -shared -o %T/simple_lib.so %S/Inputs/simple_lib.cpp

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

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

return 0;
}
}
2 changes: 1 addition & 1 deletion sycl/test-e2e/SeparateCompile/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
// RUN: clang-offload-wrapper -o wrapper.bc -host=x86_64 -kind=sycl -target=spir64 -batch test_spv.table
//
// >> compile .bc to .o
// RUN: %clangxx -Wno-error=override-module -c wrapper.bc -o wrapper.o
// RUN: %clangxx -Wno-error=override-module -c wrapper.bc -o wrapper.o %if preview-mode %{-Wno-unused-command-line-argument%}
//
// >> ---- link the full hetero app
// RUN: %clangxx wrapper.o a.o b.o -Wno-unused-command-line-argument -o app.exe %sycl_options
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/XPTI/basic_event_collection_linux.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// REQUIRES: xptifw, opencl, cpu, linux
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib -shared -fPIC -std=c++17 -o %t_collector.so
// RUN: %build_collector
// RUN: %{build} -o %t.out
// 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
// 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

#include "basic_event_collection.inc"
//
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/XPTI/buffer/accessors.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: xptifw, opencl
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
// RUN: %build_collector
// RUN: %{build} -Wno-error=deprecated-declarations -o %t.out
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/XPTI/buffer/host_array.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: xptifw, opencl
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
// RUN: %build_collector
// RUN: %{build} -o %t.out
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/XPTI/buffer/in_cycle.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: xptifw, opencl
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
// RUN: %build_collector
// RUN: %{build} -o %t.out
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/XPTI/buffer/multiple_buffers.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: xptifw, opencl
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
// RUN: %build_collector
// RUN: %{build} -o %t.out
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/XPTI/buffer/multiple_queues.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: xptifw, opencl, (cpu || accelerator)
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
// RUN: %build_collector
// RUN: %{build} -o %t.out
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/XPTI/buffer/recursion.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: xptifw, opencl
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
// RUN: %build_collector
// RUN: %{build} -o %t.out
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/XPTI/buffer/sub_buffer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: xptifw, opencl
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
// RUN: %build_collector
// RUN: %{build} -o %t.out
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/XPTI/buffer/use_host_ptr.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: xptifw, opencl
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
// RUN: %build_collector
// RUN: %{build} -o %t.out
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/XPTI/image/accessors.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// REQUIRES: xptifw, opencl
// REQUIRES: aspect-ext_intel_legacy_image
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
// RUN: %build_collector
// RUN: %{build} -o %t.out
// RUN: env XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/XPTI/kernel/basic.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: xptifw, opencl, target-spir
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
// RUN: %build_collector
// RUN: %{build} -O2 -o %t.opt.out
// 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
// RUN: %{build} -fno-sycl-dead-args-optimization -o %t.noopt.out
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/XPTI/kernel/content.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// REQUIRES: xptifw, opencl, target-spir
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib %shared_lib %fPIC %cxx_std_optionc++17 -o %t_collector.dll
// RUN: %build_collector
// RUN: %{build} -Wno-error=deprecated-declarations -O2 -o %t.opt.out
// 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
// RUN: %{build} -Wno-error=deprecated-declarations -fno-sycl-dead-args-optimization -o %t.noopt.out
Expand Down
2 changes: 2 additions & 0 deletions sycl/test-e2e/XPTI/lit.local.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Prepending instead of appending so that `%shared_lib` is expanded before `%s`.
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%}"))
4 changes: 2 additions & 2 deletions sycl/test-e2e/XPTI/mem_alloc_events_linux.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// REQUIRES: xptifw, level_zero, gpu, linux
// RUN: %clangxx %s -DXPTI_COLLECTOR -DXPTI_CALLBACK_API_EXPORTS %xptifw_lib -shared -fPIC -std=c++17 -o %t_collector.so
// RUN: %build_collector
// RUN: %{build} -o %t.out
// RUN: env XPTI_TRACE_ENABLE=1 env XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher env XPTI_SUBSCRIBERS=%t_collector.so %{run} %t.out | FileCheck %s
// RUN: env XPTI_TRACE_ENABLE=1 env XPTI_FRAMEWORK_DISPATCHER=%xptifw_dispatcher env XPTI_SUBSCRIBERS=%t_collector.dll %{run} %t.out | FileCheck %s

#include "mem_alloc_events.inc"

Expand Down
62 changes: 35 additions & 27 deletions sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,29 +330,32 @@ def open_check_file(file_name):
else:
config.substitutions.append(("%level_zero_options", ""))

# Check for sycl-preview library
check_preview_breaking_changes_file = "preview_breaking_changes_link.cpp"
with open_check_file(check_preview_breaking_changes_file) as fp:
print(
textwrap.dedent(
if lit_config.params.get("test-preview-mode", False):
config.available_features.add("preview-mode")
else:
# Check for sycl-preview library
check_preview_breaking_changes_file = "preview_breaking_changes_link.cpp"
with open_check_file(check_preview_breaking_changes_file) as fp:
print(
textwrap.dedent(
"""
#include <sycl/sycl.hpp>
namespace sycl { inline namespace _V1 { namespace detail {
extern void PreviewMajorReleaseMarker();
}}}
int main() { sycl::detail::PreviewMajorReleaseMarker(); return 0; }
"""
#include <sycl/sycl.hpp>
namespace sycl { inline namespace _V1 { namespace detail {
extern void PreviewMajorReleaseMarker();
}}}
int main() { sycl::detail::PreviewMajorReleaseMarker(); return 0; }
"""
),
file=fp,
)
),
file=fp,
)

sp = subprocess.getstatusoutput(
config.dpcpp_compiler
+ " -fsycl -fpreview-breaking-changes "
+ check_preview_breaking_changes_file
)
if sp[0] == 0:
config.available_features.add("preview-breaking-changes-supported")
sp = subprocess.getstatusoutput(
config.dpcpp_compiler
+ " -fsycl -fpreview-breaking-changes "
+ check_preview_breaking_changes_file
)
if sp[0] == 0:
config.available_features.add("preview-breaking-changes-supported")

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

if lit_config.params.get("print_features", False):
lit_config.note(
Expand Down
Loading