|
| 1 | +# Overview |
| 2 | +SYCL related test based on SYCL-LIT. These tests support |
| 3 | +execution on all supported devices and SYCL backends. |
| 4 | + |
| 5 | +# Table of contents |
| 6 | + * [Execution](#execution) |
| 7 | + * [Main parameters](#main-parameters) |
| 8 | + * [LIT features which can be used to configure test execution](#lit-features-which-can-be-used-to-configure-test-execution) |
| 9 | + |
| 10 | +# Execution |
| 11 | +``` |
| 12 | +git clone <GIT_REPO> # e.g. https://github.com/vladimirlaz/llvm-test-suite |
| 13 | +cd llvm-test-suite |
| 14 | +mkdir build |
| 15 | +cd build |
| 16 | +# configuring test execution (selecting compiler version, target BE and target device) |
| 17 | +cmake -G Ninja -DTEST_SUITE_SUBDIRS=SYCL -DTEST_SUITE_LIT=<PATH_TO_llvm-lit> -DSYCL_BE=<SYCL_BE> -DSYCL_TARGET_DEVICES=<TARGET_DEVICES> -C<CMAKE_CHASHED_CONFIG> .. |
| 18 | +# Building full list of tests in subdir |
| 19 | +ninja check |
| 20 | +# or |
| 21 | +llvm-lit . |
| 22 | +# Get list of available tests |
| 23 | +llvm-lit . --show-tests |
| 24 | +# Run specific test |
| 25 | +llvm-lit <path_to_test> |
| 26 | +``` |
| 27 | + |
| 28 | +Notes: |
| 29 | + - it is assumed that LIT framework, FileCheck and other LIT dependencies are available in the same directory with llvm-lit. |
| 30 | + - compiler variant as well as compile/link options are defined in cashed cmake configurations: |
| 31 | + - [dpcpp.cmake](../../cmake/caches/dpcpp.cmake) |
| 32 | + - [clang_fsycl.cmake](../../cmake/cashes/clang_fsycl.cmake) |
| 33 | + - [clang_fsycl_cuda.cmake](../../cmake/cashes/clang_fsycl_cuda.cmake) |
| 34 | + - compiler is taken from environment. |
| 35 | + |
| 36 | +# Main parameters |
| 37 | +It is possible to change tets scope my specifying test directory/file in first |
| 38 | +argument to for thelit-runner.py script. |
| 39 | + |
| 40 | +***SYCL_TARGET_DEVICES*** should point to the directory containing DPCPP compiler |
| 41 | + |
| 42 | +***SYCL_TARGET_DEVICES*** defines comma separated target device types (default value is |
| 43 | + cpu,gpu,acc,host). Supported target_devices values are: |
| 44 | + - **cpu** - CPU device available in OpenCL backend only; |
| 45 | + - **gpu** - GPU device available in OpenCL, Level Zero and CUDA backends; |
| 46 | + - **acc** - FPGA emulator device available in OpenCL backend only; |
| 47 | + - **host** - SYCL Host device availabel with all backends. |
| 48 | + |
| 49 | +***SYCL_BE*** defined SYCL backend to be used for testing (default is PI_OPENCL). |
| 50 | +Supported sycl_be values: |
| 51 | + - PI_OPENCL - for OpenCL backend; |
| 52 | + - PI_CUDA - for CUDA backend; |
| 53 | + - PI_LEVEL0 - Level Zero backend. |
| 54 | + |
| 55 | +It is asssumed that all dependencies (OpenCL runtimes, |
| 56 | +CUDA SDK, AOT compilers, etc) are available in the system. |
| 57 | + |
| 58 | +See examples below for configuring tests targetting different devices: |
| 59 | + - SYCL host: |
| 60 | +``` |
| 61 | +cmake -G Ninja -DTEST_SUITE_COLLECT_CODE_SIZE=OFF -DTEST_SUITE_COLLECT_COMPILE_TIME=OFF -DTEST_SUITE_SUBDIRS=SYCL -DTEST_SUITE_LIT=<PATH_TO_llvm-lit> -DSYCL_BE=PI_OPENCL -DSYCL_TARGET_DEVICES="host" -C../cmake/caches/clang_fsycl.cmake .. |
| 62 | +``` |
| 63 | + - OpenCL GPU |
| 64 | +``` |
| 65 | +cmake -G Ninja -DTEST_SUITE_COLLECT_CODE_SIZE=OFF -DTEST_SUITE_COLLECT_COMPILE_TIME=OFF -DTEST_SUITE_SUBDIRS=SYCL -DTEST_SUITE_LIT=<PATH_TO_llvm-lit> -DSYCL_BE=PI_OPENCL -DSYCL_TARGET_DEVICES="gpu" -C../cmake/caches/clang_fsycl.cmake .. |
| 66 | +``` |
| 67 | + - OpenCL CPU |
| 68 | +``` |
| 69 | +cmake -G Ninja -DTEST_SUITE_COLLECT_CODE_SIZE=OFF -DTEST_SUITE_COLLECT_COMPILE_TIME=OFF -DTEST_SUITE_SUBDIRS=SYCL -DTEST_SUITE_LIT=<PATH_TO_llvm-lit> -DSYCL_BE=PI_OPENCL -DSYCL_TARGET_DEVICES="gpu" -C../cmake/caches/clang_fsycl.cmake .. |
| 70 | +``` |
| 71 | + - OpenCL FPGA emulator |
| 72 | +``` |
| 73 | +cmake -G Ninja -DTEST_SUITE_COLLECT_CODE_SIZE=OFF -DTEST_SUITE_COLLECT_COMPILE_TIME=OFF -DTEST_SUITE_SUBDIRS=SYCL -DTEST_SUITE_LIT=<PATH_TO_llvm-lit> -DSYCL_BE=PI_OPENCL -DSYCL_TARGET_DEVICES="gpu" -C../cmake/caches/clang_fsycl.cmake .. |
| 74 | +``` |
| 75 | + - CUDA GPU |
| 76 | +``` |
| 77 | +cmake -G Ninja -DTEST_SUITE_COLLECT_CODE_SIZE=OFF -DTEST_SUITE_COLLECT_COMPILE_TIME=OFF -DTEST_SUITE_SUBDIRS=SYCL -DTEST_SUITE_LIT=<PATH_TO_llvm-lit> -DSYCL_BE=PI_CUDA -DSYCL_TARGET_DEVICES="gpu" -C../cmake/caches/clang_fsycl_cuda.cmake .. |
| 78 | +``` |
| 79 | + - Level Zero GPU |
| 80 | +``` |
| 81 | +cmake -G Ninja -DTEST_SUITE_COLLECT_CODE_SIZE=OFF -DTEST_SUITE_COLLECT_COMPILE_TIME=OFF -DTEST_SUITE_SUBDIRS=SYCL -DTEST_SUITE_LIT=<PATH_TO_llvm-lit> -DSYCL_BE=PI_LEVEL0 -DSYCL_TARGET_DEVICES="gpu" -C../cmake/caches/clang_fsycl.cmake .. |
| 82 | +``` |
| 83 | + |
| 84 | +# LIT features which can be used to configure test execution: |
| 85 | + - **windows**, **linux** - host OS; |
| 86 | + - **cpu**, **gpu**, **host**, **acc** - target devices; |
| 87 | + - **cuda**, **opencl**, **level0** - target backend; |
| 88 | + - **sycl-ls** - sycl-ls tool is available; |
| 89 | + - **dump_ir**: is set to true if compiler supports dumiping IR. Can be set by setting DUMP_IR_SUPPORTED in cmake. Default is false. |
| 90 | + |
0 commit comments