Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.
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
2 changes: 1 addition & 1 deletion SYCL/AOT/gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
// UNSUPPORTED: cuda
// CUDA is not compatible with SPIR.
//
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device *" %S/Inputs/aot.cpp -o %t.out
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %S/Inputs/aot.cpp -o %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
2 changes: 1 addition & 1 deletion SYCL/AOT/multiple-devices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// 1-command compilation case
// Targeting CPU, GPU, FPGA
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen,spir64_fpga -Xsycl-target-backend=spir64_gen "-device *" %S/Inputs/aot.cpp -o %t_all.out
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen,spir64_fpga -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %S/Inputs/aot.cpp -o %t_all.out
// RUN: %HOST_RUN_PLACEHOLDER %t_all.out
// RUN: %CPU_RUN_PLACEHOLDER %t_all.out
// RUN: %GPU_RUN_PLACEHOLDER %t_all.out
Expand Down
2 changes: 1 addition & 1 deletion SYCL/DeviceCodeSplit/aot-gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// RUN: %clangxx -fsycl -fsycl-device-code-split=per_source \
// RUN: -fsycl-targets=spir64_gen \
// RUN: -Xsycl-target-backend=spir64_gen \
// RUN: "-device *" -I %S/Inputs -o %t.out \
// RUN: %gpu_aot_target_opts -I %S/Inputs -o %t.out \
// RUN: %S/split-per-source-main.cpp \
// RUN: %S/Inputs/split-per-source-second-file.cpp \
// RUN: -fsycl-dead-args-optimization
Expand Down
6 changes: 3 additions & 3 deletions SYCL/ESIMD/aot_mixed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
// RUN: %GPU_RUN_PLACEHOLDER %t.out
// XFAIL: *
// TODO: remove XFAIL once ocloc support for automatic scalar/vector SPIRV
// module dispatching is available in public drivers. Also change 'gen9' (safe
// variant to reliably get unexpected PASS when ocloc is fixed) to '*' (which
// stresses ocloc).
// module dispatching is available in public drivers. Also change '-device gen9'
// (safe variant to reliably get unexpected PASS when ocloc is fixed) to
// %gpu_aot_target_opts aka '-device *' (which stresses ocloc).

// This test checks ESIMD ahead-of-time compilation scenarios:
// 1) When the application contains both SYCL and ESIMD kernel, thus requiring
Expand Down
40 changes: 23 additions & 17 deletions SYCL/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ ninja check-sycl-all

These parameters can be used to configure tests:

***CMAKE_CXX_COMPILER*** path DPCPP compiler
***CMAKE_CXX_COMPILER*** - path to DPCPP compiler

***TEST_SUITE_LLVM_SIZE*** path to llvm-size tool, required for code size
***TEST_SUITE_LLVM_SIZE*** - path to llvm-size tool, required for code size
collection

***TEST_SUITE_COLLECT_COMPILE_TIME=OFF*** can be used to turn off compile time
collection
***TEST_SUITE_COLLECT_COMPILE_TIME=OFF*** - can be used to turn off compile
time collection

***TEST_SUITE_COLLECT_CODE_SIZE=OFF*** can be used to turn off code size
***TEST_SUITE_COLLECT_CODE_SIZE=OFF*** - can be used to turn off code size
collection

***TEST_SUITE_LIT*** path to llvm-lit tool
***TEST_SUITE_LIT*** - path to llvm-lit tool

***CHECK_SYCL_ALL*** defines selection of multiple SYCL backends with set of
***CHECK_SYCL_ALL*** - defines selection of multiple SYCL backends with set of
target devices per each to be tested iteratively. Value is semicolon-separated
list of configurations. Each configuration includes backend separated
from comma-separated list of target devices with colon. Example:
Expand All @@ -84,36 +84,39 @@ from comma-separated list of target devices with colon. Example:
-DCHECK_SYCL_ALL="opencl:cpu,host;level_zero:gpu,host;cuda:gpu;hip:gpu"
```

***SYCL_BE*** SYCL backend to be used for testing. Supported values are:
***SYCL_BE*** - SYCL backend to be used for testing. Supported values are:
- **opencl** - for OpenCL backend;
- **cuda** - for CUDA backend;
- **hip** - for HIP backend;
- **level_zero** - Level Zero backend.

***SYCL_TARGET_DEVICES*** comma separated list of target devices for testing.
***SYCL_TARGET_DEVICES*** - comma separated list of target devices for testing.
Default value is cpu,gpu,acc,host. Supported values are:
- **cpu** - CPU device available in OpenCL backend only;
- **gpu** - GPU device available in OpenCL, Level Zero, CUDA, and HIP backends;
- **acc** - FPGA emulator device available in OpenCL backend only;
- **host** - SYCL Host device available with all backends.

***OpenCL_LIBRARY*** path to OpenCL ICD loader library. OpenCL interoperability
tests require OpenCL ICD loader to be linked with. For such tests OpenCL ICD
loader library should be installed in the system or available at the full path
specified by this variable.
***OpenCL_LIBRARY*** - path to OpenCL ICD loader library. OpenCL
interoperability tests require OpenCL ICD loader to be linked with. For such
tests OpenCL ICD loader library should be installed in the system or available
at the full path specified by this variable.

***LEVEL_ZERO_INCLUDE*** path to Level Zero headers.
***LEVEL_ZERO_INCLUDE*** - path to Level Zero headers.

***LEVEL_ZERO_LIBS_DIR*** path to Level Zero libraries.
***LEVEL_ZERO_LIBS_DIR*** - path to Level Zero libraries.

***HIP_PLATFORM*** platform selection for HIP targeted devices.
***HIP_PLATFORM*** - platform selection for HIP targeted devices.
Defaults to AMD if no value is given. Supported values are:
- **AMD** - for HIP to target AMD GPUs
- **NVIDIA** - for HIP to target NVIDIA GPUs

***AMD_ARCH*** Flag must be set for when using HIP AMD triple.
***AMD_ARCH*** - flag must be set for when using HIP AMD triple.
For example it may be set to "gfx906".

***GPU_AOT_TARGET_OPTS*** - defines additional options which are passed to AOT
compilation command line for GPU device. If not specified "-device *" value
is used.

# Special test categories

Expand Down Expand Up @@ -154,6 +157,9 @@ configure specific single test execution in the command line:
host);
* **sycl_be** - SYCL backend to be used (opencl, level_zero, cuda, hip);
* **dump_ir** - if IR dumping is supported for compiler (True, False);
* **gpu_aot_target_opts** - defines additional options which are passed to AOT
compilation command line for GPU device. It can be also set by CMake variable
GPU_AOT_TARGET_OPTS. If not specified "-device *" value is used.
* **gpu-intel-dg1** - tells LIT infra that Intel GPU DG1 is present in the
system. It is developer / CI infra responsibility to make sure that the
device is available in the system. Tests requiring DG1 to run must use proper
Expand Down
2 changes: 1 addition & 1 deletion SYCL/SpecConstants/2020/non_native/gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// UNSUPPORTED: hip
// HIP is not compatible with SPIR.

// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device *" %S/Inputs/common.cpp -o %t.out -fsycl-dead-args-optimization
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %S/Inputs/common.cpp -o %t.out -fsycl-dead-args-optimization
// RUN: %GPU_RUN_PLACEHOLDER %t.out

// This test checks correctness of SYCL2020 non-native specialization constants
Expand Down
5 changes: 5 additions & 0 deletions SYCL/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@
config.substitutions.append( ('%debug_option', '-g' ) )
config.substitutions.append( ('%cxx_std_option', '-std=' ) )

if not config.gpu_aot_target_opts:
config.gpu_aot_target_opts = '"-device *"'

config.substitutions.append( ('%gpu_aot_target_opts', config.gpu_aot_target_opts ) )

if not config.sycl_be:
lit_config.error("SYCL backend is not specified")

Expand Down
1 change: 1 addition & 0 deletions SYCL/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ config.cxx_flags = "@CMAKE_CXX_FLAGS@"
config.c_flags = "@CMAKE_C_FLAGS@"
config.external_tests = "@SYCL_EXTERNAL_TESTS@"
config.extra_include = "@CMAKE_CURRENT_SOURCE_DIR@/include"
config.gpu_aot_target_opts = lit_config.params.get("gpu_aot_target_opts", "@GPU_AOT_TARGET_OPTS@")

import lit.llvm
lit.llvm.initialize(lit_config, config)
Expand Down