diff --git a/.github/workflows/sycl-nightly.yml b/.github/workflows/sycl-nightly.yml index b524ba2ac2f73..572284125449f 100644 --- a/.github/workflows/sycl-nightly.yml +++ b/.github/workflows/sycl-nightly.yml @@ -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 }} diff --git a/sycl/test-e2e/Basic/backend_info.cpp b/sycl/test-e2e/Basic/backend_info.cpp index 3607f89f1c04e..3ce5d2bc378af 100644 --- a/sycl/test-e2e/Basic/backend_info.cpp +++ b/sycl/test-e2e/Basic/backend_info.cpp @@ -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 // diff --git a/sycl/test-e2e/Config/kernel_from_file.cpp b/sycl/test-e2e/Config/kernel_from_file.cpp index 37c2273b43903..b8d340256c658 100644 --- a/sycl/test-e2e/Config/kernel_from_file.cpp +++ b/sycl/test-e2e/Config/kernel_from_file.cpp @@ -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 diff --git a/sycl/test-e2e/E2EExpr.py b/sycl/test-e2e/E2EExpr.py index 94eda0bf0492b..00856bf0bb1f5 100644 --- a/sycl/test-e2e/E2EExpr.py +++ b/sycl/test-e2e/E2EExpr.py @@ -4,6 +4,7 @@ class E2EExpr(BooleanExpression): build_specific_features = { "build-and-run-mode", + "preview-mode", "target-spir", "target-nvidia", "target-amd", diff --git a/sycl/test-e2e/IntermediateLib/dynamic_app_linux.cpp b/sycl/test-e2e/IntermediateLib/dynamic_app_linux.cpp index 39299fe603a68..18f8b3c596dc5 100644 --- a/sycl/test-e2e/IntermediateLib/dynamic_app_linux.cpp +++ b/sycl/test-e2e/IntermediateLib/dynamic_app_linux.cpp @@ -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 @@ -65,4 +65,4 @@ int main() { assert(result == 7); return 0; -} \ No newline at end of file +} diff --git a/sycl/test-e2e/SeparateCompile/test.cpp b/sycl/test-e2e/SeparateCompile/test.cpp index dd2c9b41bfc18..3704d5c20a9e2 100644 --- a/sycl/test-e2e/SeparateCompile/test.cpp +++ b/sycl/test-e2e/SeparateCompile/test.cpp @@ -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 diff --git a/sycl/test-e2e/XPTI/basic_event_collection_linux.cpp b/sycl/test-e2e/XPTI/basic_event_collection_linux.cpp index ef6142d392e09..0e9be2ed889fb 100644 --- a/sycl/test-e2e/XPTI/basic_event_collection_linux.cpp +++ b/sycl/test-e2e/XPTI/basic_event_collection_linux.cpp @@ -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" // diff --git a/sycl/test-e2e/XPTI/buffer/accessors.cpp b/sycl/test-e2e/XPTI/buffer/accessors.cpp index f7412c0744cdd..ed04243675a73 100644 --- a/sycl/test-e2e/XPTI/buffer/accessors.cpp +++ b/sycl/test-e2e/XPTI/buffer/accessors.cpp @@ -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 diff --git a/sycl/test-e2e/XPTI/buffer/host_array.cpp b/sycl/test-e2e/XPTI/buffer/host_array.cpp index 2574f93ae53f6..b2c56dd14528d 100644 --- a/sycl/test-e2e/XPTI/buffer/host_array.cpp +++ b/sycl/test-e2e/XPTI/buffer/host_array.cpp @@ -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 diff --git a/sycl/test-e2e/XPTI/buffer/in_cycle.cpp b/sycl/test-e2e/XPTI/buffer/in_cycle.cpp index 18075e22a7ca8..f639f33eec731 100644 --- a/sycl/test-e2e/XPTI/buffer/in_cycle.cpp +++ b/sycl/test-e2e/XPTI/buffer/in_cycle.cpp @@ -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 diff --git a/sycl/test-e2e/XPTI/buffer/multiple_buffers.cpp b/sycl/test-e2e/XPTI/buffer/multiple_buffers.cpp index 247a5182413c8..a7b5358007698 100644 --- a/sycl/test-e2e/XPTI/buffer/multiple_buffers.cpp +++ b/sycl/test-e2e/XPTI/buffer/multiple_buffers.cpp @@ -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 diff --git a/sycl/test-e2e/XPTI/buffer/multiple_queues.cpp b/sycl/test-e2e/XPTI/buffer/multiple_queues.cpp index 3085c0b621cb0..6d32468c8c02a 100644 --- a/sycl/test-e2e/XPTI/buffer/multiple_queues.cpp +++ b/sycl/test-e2e/XPTI/buffer/multiple_queues.cpp @@ -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 diff --git a/sycl/test-e2e/XPTI/buffer/recursion.cpp b/sycl/test-e2e/XPTI/buffer/recursion.cpp index 9a2044c0e8d97..8182f1fd09ebd 100644 --- a/sycl/test-e2e/XPTI/buffer/recursion.cpp +++ b/sycl/test-e2e/XPTI/buffer/recursion.cpp @@ -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 diff --git a/sycl/test-e2e/XPTI/buffer/sub_buffer.cpp b/sycl/test-e2e/XPTI/buffer/sub_buffer.cpp index f660ef7b17456..0a225a138981c 100644 --- a/sycl/test-e2e/XPTI/buffer/sub_buffer.cpp +++ b/sycl/test-e2e/XPTI/buffer/sub_buffer.cpp @@ -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 diff --git a/sycl/test-e2e/XPTI/buffer/use_host_ptr.cpp b/sycl/test-e2e/XPTI/buffer/use_host_ptr.cpp index 23e0f2e44ff80..a06e34fe878b1 100644 --- a/sycl/test-e2e/XPTI/buffer/use_host_ptr.cpp +++ b/sycl/test-e2e/XPTI/buffer/use_host_ptr.cpp @@ -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 diff --git a/sycl/test-e2e/XPTI/image/accessors.cpp b/sycl/test-e2e/XPTI/image/accessors.cpp index 80caefa175cd6..6d24d877deec4 100644 --- a/sycl/test-e2e/XPTI/image/accessors.cpp +++ b/sycl/test-e2e/XPTI/image/accessors.cpp @@ -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 diff --git a/sycl/test-e2e/XPTI/kernel/basic.cpp b/sycl/test-e2e/XPTI/kernel/basic.cpp index 0b510e563a737..217a78e2aaa56 100644 --- a/sycl/test-e2e/XPTI/kernel/basic.cpp +++ b/sycl/test-e2e/XPTI/kernel/basic.cpp @@ -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 diff --git a/sycl/test-e2e/XPTI/kernel/content.cpp b/sycl/test-e2e/XPTI/kernel/content.cpp index 4bfb69112a5a8..f17e2defa5893 100644 --- a/sycl/test-e2e/XPTI/kernel/content.cpp +++ b/sycl/test-e2e/XPTI/kernel/content.cpp @@ -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 diff --git a/sycl/test-e2e/XPTI/lit.local.cfg b/sycl/test-e2e/XPTI/lit.local.cfg new file mode 100644 index 0000000000000..75dc17661b38c --- /dev/null +++ b/sycl/test-e2e/XPTI/lit.local.cfg @@ -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%}")) diff --git a/sycl/test-e2e/XPTI/mem_alloc_events_linux.cpp b/sycl/test-e2e/XPTI/mem_alloc_events_linux.cpp index 82a878acd0551..02a32cfb74ff1 100644 --- a/sycl/test-e2e/XPTI/mem_alloc_events_linux.cpp +++ b/sycl/test-e2e/XPTI/mem_alloc_events_linux.cpp @@ -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" diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index 55688b5a29928..fb4e8b3685658 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -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 + namespace sycl { inline namespace _V1 { namespace detail { + extern void PreviewMajorReleaseMarker(); + }}} + int main() { sycl::detail::PreviewMajorReleaseMarker(); return 0; } """ - #include - 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 "" @@ -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(