diff --git a/SYCL/AOT/multiple-devices.cpp b/SYCL/AOT/multiple-devices.cpp index f7ac3d8969..7f77d4bc90 100644 --- a/SYCL/AOT/multiple-devices.cpp +++ b/SYCL/AOT/multiple-devices.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// REQUIRES: opencl-aot, ocloc, aoc, cpu, gpu, accelerator +// REQUIRES: opencl-aot, ocloc, aoc, cpu, gpu, accelerator, llvm-link, llvm-spirv // UNSUPPORTED: cuda // CUDA is not compatible with SPIR. @@ -18,11 +18,19 @@ // RUN: %GPU_RUN_PLACEHOLDER %t_all.out // RUN: %ACC_RUN_PLACEHOLDER %t_all.out +// FIXME: Change the behavior when proper automation for assert support is +// introduced // Produce object file, spirv, device images to combine these differently // at link-time, thus testing various AOT-compiled images configurations // RUN: %clangxx -fsycl %S/Inputs/aot.cpp -c -o %t.o // RUN: %clangxx -fsycl -fsycl-link-targets=spir64-unknown-unknown-sycldevice %t.o -o %t.spv // AOT-compile device binary images +// Neither of AOT tools can compile several files, hence, here is this +// workaround +// RUN: %llvm_spirv -r %sycl_libs_dir/libsycl-fallback-cassert.spv -o=%T/fallback-cassert.bc +// RUN: %llvm_spirv -r %t.spv -o=%t.bc +// RUN: %llvm_link %t.bc %T/fallback-cassert.bc -o=%t2.bc +// RUN: %llvm_spirv %t2.bc -o=%t.spv // RUN: opencl-aot %t.spv -o=%t_cpu.ir --device=cpu // RUN: ocloc -file %t.spv -spirv_input -output %t_gen.out -output_no_suffix -device cfl // RUN: aoc %t.spv -o %t_fpga.aocx -sycl -dep-files=%t.d diff --git a/SYCL/Basic/device_code_dae.cpp b/SYCL/Basic/device_code_dae.cpp index 62878c67d3..c511c54f8e 100644 --- a/SYCL/Basic/device_code_dae.cpp +++ b/SYCL/Basic/device_code_dae.cpp @@ -2,8 +2,10 @@ // driver // UNSUPPORTED: cuda // CUDA does not support SPIR-V. -// RUN: %clangxx -fsycl-device-only -Xclang -fenable-sycl-dae -Xclang -fsycl-int-header=int_header.h %s -c -o device_code.bc -Wno-sycl-strict -// RUN: %clangxx %cxx_std_optionc++17 %include_option int_header.h %debug_option -c %s -o host_code.o %sycl_options -Wno-sycl-strict +// FIXME Disabled fallback assert as it'll require either online linking or +// explicit offline linking step here +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT -fsycl-device-only -Xclang -fenable-sycl-dae -Xclang -fsycl-int-header=int_header.h %s -c -o device_code.bc -Wno-sycl-strict +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option int_header.h %debug_option -c %s -o host_code.o %sycl_options -Wno-sycl-strict // RUN: llvm-link -o=linked_device_code.bc device_code.bc // RUN: sycl-post-link -emit-param-info linked_device_code.bc // RUN: llvm-spirv -o linked_device_code.spv linked_device_code.bc diff --git a/SYCL/Basic/fpga_tests/fpga_aocx.cpp b/SYCL/Basic/fpga_tests/fpga_aocx.cpp index a01331c50d..5227027091 100644 --- a/SYCL/Basic/fpga_tests/fpga_aocx.cpp +++ b/SYCL/Basic/fpga_tests/fpga_aocx.cpp @@ -11,15 +11,17 @@ /// E2E test for AOCX creation/use/run for FPGA // Produce an archive with device (AOCX) image. To avoid appending objects to // leftover archives, remove one if exists. +// FIXME Disabled use of devicelib by assert feature until the 2-step build gets +// fixed. // RUN: rm %t_image.a || true -// RUN: %clangxx -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.a +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT=1 -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.a // Produce a host object -// RUN: %clangxx -fsycl -fintelfpga %S/Inputs/fpga_host.cpp -c -o %t.o +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT=1 -fsycl -fintelfpga %S/Inputs/fpga_host.cpp -c -o %t.o // AOCX with source -// RUN: %clangxx -fsycl -fintelfpga %S/Inputs/fpga_host.cpp %t_image.a -o %t_aocx_src.out +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT=1 -fsycl -fintelfpga %S/Inputs/fpga_host.cpp %t_image.a -o %t_aocx_src.out // AOCX with object -// RUN: %clangxx -fsycl -fintelfpga %t.o %t_image.a -o %t_aocx_obj.out +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT=1 -fsycl -fintelfpga %t.o %t_image.a -o %t_aocx_obj.out // // RUN: %ACC_RUN_PLACEHOLDER %t_aocx_src.out // RUN: %ACC_RUN_PLACEHOLDER %t_aocx_obj.out diff --git a/SYCL/Basic/fpga_tests/fpga_aocx_win.cpp b/SYCL/Basic/fpga_tests/fpga_aocx_win.cpp index baf7518841..efc6c98efe 100644 --- a/SYCL/Basic/fpga_tests/fpga_aocx_win.cpp +++ b/SYCL/Basic/fpga_tests/fpga_aocx_win.cpp @@ -12,15 +12,17 @@ /// E2E test for AOCX creation/use/run for FPGA // Produce an archive with device (AOCX) image. To avoid appending objects to // leftover archives, remove one if exists. +// FIXME Disabled use of devicelib by assert feature until the 2-step build gets +// fixed. // RUN: rm %t_image.a || true -// RUN: %clangxx -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.lib +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT=1 -fsycl -fintelfpga -fsycl-link=image %S/Inputs/fpga_device.cpp -o %t_image.lib // Produce a host object -// RUN: %clangxx -fsycl -fintelfpga -DHOST_PART %S/Inputs/fpga_host.cpp -c -o %t.obj +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT=1 -fsycl -fintelfpga -DHOST_PART %S/Inputs/fpga_host.cpp -c -o %t.obj // AOCX with source -// RUN: %clangxx -fsycl -fintelfpga -DHOST_PART %S/Inputs/fpga_host.cpp %t_image.lib -o %t_aocx_src.out +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT=1 -fsycl -fintelfpga -DHOST_PART %S/Inputs/fpga_host.cpp %t_image.lib -o %t_aocx_src.out // AOCX with object -// RUN: %clangxx -fsycl -fintelfpga %t.obj %t_image.lib -o %t_aocx_obj.out +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT=1 -fsycl -fintelfpga %t.obj %t_image.lib -o %t_aocx_obj.out // // RUN: %ACC_RUN_PLACEHOLDER %t_aocx_src.out // RUN: %ACC_RUN_PLACEHOLDER %t_aocx_obj.out diff --git a/SYCL/Config/kernel_from_file.cpp b/SYCL/Config/kernel_from_file.cpp index 9d5b4ff8f9..8ad438fcda 100644 --- a/SYCL/Config/kernel_from_file.cpp +++ b/SYCL/Config/kernel_from_file.cpp @@ -1,8 +1,10 @@ // UNSUPPORTED: cuda // CUDA does not support SPIR-V. -// RUN: %clangxx %cxx_std_optionc++17 -fsycl-device-only -fno-sycl-use-bitcode -Xclang -fsycl-int-header=%t.h -c %s -o %t.spv -Xclang -verify-ignore-unexpected=note,warning -Wno-sycl-strict -// RUN: %clangxx %cxx_std_optionc++17 %include_option %t.h %s -o %t.out %sycl_options -Xclang -verify-ignore-unexpected=note,warning +// FIXME Disabled fallback assert as it'll require either online linking or +// explicit offline linking step here +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 -fsycl-device-only -fno-sycl-use-bitcode -Xclang -fsycl-int-header=%t.h -c %s -o %t.spv -Xclang -verify-ignore-unexpected=note,warning -Wno-sycl-strict +// RUN: %clangxx -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: %BE_RUN_PLACEHOLDER env SYCL_USE_KERNEL_SPV=%t.spv %t.out | FileCheck %s // CHECK: Passed diff --git a/SYCL/DeviceLib/assert-aot.cpp b/SYCL/DeviceLib/assert-aot.cpp index 811f174b39..142384fba7 100644 --- a/SYCL/DeviceLib/assert-aot.cpp +++ b/SYCL/DeviceLib/assert-aot.cpp @@ -1,5 +1,6 @@ -// REQUIRES: opencl-aot, cpu, linux +// REQUIRES: opencl-aot, cpu, linux, UNSUPPORTED +// FIXME re-enable after intel/llvm#3767 is merged // RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice %S/assert.cpp -o %t.aot.out -// RUN: %CPU_RUN_PLACEHOLDER %t.aot.out >%t.aot.msg +// RUN: %CPU_RUN_PLACEHOLDER EXPECTED_SIGNAL=SIGABRT SHOULD_CRASH=1 %t.aot.out 2>%t.aot.msg // RUN: FileCheck %S/assert.cpp --input-file %t.aot.msg --check-prefixes=CHECK-MESSAGE diff --git a/SYCL/ESIMD/spec_const_redefine_esimd.cpp b/SYCL/ESIMD/spec_const_redefine_esimd.cpp index 6c3cdca90b..a2ae9806a5 100755 --- a/SYCL/ESIMD/spec_const_redefine_esimd.cpp +++ b/SYCL/ESIMD/spec_const_redefine_esimd.cpp @@ -1,6 +1,8 @@ // TODO enable on Windows // REQUIRES: linux && gpu -// RUN: %clangxx -fsycl %s -o %t.out +// FIXME Disable fallback assert so that it doesn't interferes with number of +// program builds at run-time +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT -fsycl %s -o %t.out // RUN: env SYCL_PI_TRACE=2 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER // UNSUPPORTED: cuda diff --git a/SYCL/SeparateCompile/test.cpp b/SYCL/SeparateCompile/test.cpp index 64a6291bec..f3b7caf271 100644 --- a/SYCL/SeparateCompile/test.cpp +++ b/SYCL/SeparateCompile/test.cpp @@ -1,17 +1,19 @@ // UNSUPPORTED: cuda // CUDA does not support SPIR-V. // +// FIXME Disabled fallback assert as it'll require either online linking or +// explicit offline linking step here // >> ---- compile src1 // >> device compilation... -// RUN: %clangxx -fsycl-device-only -Xclang -fsycl-int-header=sycl_ihdr_a.h %s -c -o a_kernel.bc -Wno-sycl-strict +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT -fsycl-device-only -Xclang -fsycl-int-header=sycl_ihdr_a.h %s -c -o a_kernel.bc -Wno-sycl-strict // >> host compilation... -// RUN: %clangxx %cxx_std_optionc++17 %include_option sycl_ihdr_a.h %debug_option -c %s -o a.o %sycl_options -Wno-sycl-strict +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT %cxx_std_optionc++17 %include_option sycl_ihdr_a.h %debug_option -c %s -o a.o %sycl_options -Wno-sycl-strict // // >> ---- compile src2 // >> device compilation... -// RUN: %clangxx -DB_CPP=1 -fsycl-device-only -Xclang -fsycl-int-header=sycl_ihdr_b.h %s -c -o b_kernel.bc -Wno-sycl-strict +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT -DB_CPP=1 -fsycl-device-only -Xclang -fsycl-int-header=sycl_ihdr_b.h %s -c -o b_kernel.bc -Wno-sycl-strict // >> host compilation... -// RUN: %clangxx -DB_CPP=1 %cxx_std_optionc++17 %include_option sycl_ihdr_b.h %debug_option -c %s -o b.o %sycl_options -Wno-sycl-strict +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT -DB_CPP=1 %cxx_std_optionc++17 %include_option sycl_ihdr_b.h %debug_option -c %s -o b.o %sycl_options -Wno-sycl-strict // // >> ---- bundle .o with .spv // >> run bundler diff --git a/SYCL/SpecConstants/1.2.1/spec_const_redefine.cpp b/SYCL/SpecConstants/1.2.1/spec_const_redefine.cpp index 19151bee6f..cc0b5d9e82 100644 --- a/SYCL/SpecConstants/1.2.1/spec_const_redefine.cpp +++ b/SYCL/SpecConstants/1.2.1/spec_const_redefine.cpp @@ -1,6 +1,8 @@ // UNSUPPORTED: cuda // -// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out +// FIXME Disable fallback assert so that it doesn't interferes with number of +// program builds at run-time +// RUN: %clangxx -DSYCL_DISABLE_FALLBACK_ASSERT -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: env SYCL_PI_TRACE=2 %CPU_RUN_PLACEHOLDER %t.out 2>&1 %CPU_CHECK_PLACEHOLDER // RUN: env SYCL_PI_TRACE=2 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER diff --git a/SYCL/lit.cfg.py b/SYCL/lit.cfg.py index 4b438d2796..3ff9e79dd2 100644 --- a/SYCL/lit.cfg.py +++ b/SYCL/lit.cfg.py @@ -281,6 +281,17 @@ if find_executable('sycl-ls'): config.available_features.add('sycl-ls') +llvm_tools = ["llvm-spirv", "llvm-link"] +for llvm_tool in llvm_tools: + llvm_tool_path = find_executable(llvm_tool) + if llvm_tool_path: + lit_config.note("Found " + llvm_tool) + config.available_features.add(llvm_tool) + config.substitutions.append( ('%' + llvm_tool.replace('-', '_'), + os.path.realpath(llvm_tool_path)) ) + else: + lit_config.warning("Can't find " + llvm_tool) + # Device AOT compilation tools aren't part of the SYCL project, # so they need to be pre-installed on the machine aot_tools = ["ocloc", "aoc", "opencl-aot"]