|
1 |
| -# Table of contents |
2 |
| - * [Overview](#overview) |
3 |
| - * [Execution](#execution) |
4 |
| - * [Directory structure](#directory-structure) |
5 |
| - * [CMake parameters](#cmake-parameters) |
6 |
| - * [LIT parameters accepted by LIT executor](#lit-parameters-accepted-by-lit-executor) |
7 |
| - * [LIT features which can be used to configure test execution](#lit-features-which-can-be-used-to-configure-test-execution) |
| 1 | +> **NOTE** |
| 2 | +> This is experimental extension of test suite. Could be dropped or extended |
| 3 | +> further at some later point. |
8 | 4 |
|
9 | 5 | # Overview
|
10 |
| -This directory contains SYCL-related infrastructure for running tests which |
11 |
| -sources are stored outside of this repository. Tests are distributed in |
12 |
| -sub-directories. One directory per application/test repository. |
13 | 6 |
|
14 |
| -# Execution |
15 |
| -``` |
16 |
| -git clone <GIT_REPO> # e.g. https://github.com/intel/llvm-test-suite |
17 |
| -cd llvm-test-suite |
18 |
| -mkdir build |
19 |
| -cd build |
20 |
| -# configuring test execution (selecting compiler, target BE and target device, |
21 |
| -#downloading and building RSBench sources from default location) |
22 |
| -cmake -G Ninja \ |
23 |
| - -DTEST_SUITE_SUBDIRS=SYCL \ |
24 |
| - -DTEST_SUITE_LIT=<PATH_TO_llvm-lit> \ |
25 |
| - -DCHECK_SYCL_ALL="opencl:cpu,acc,gpu,host;level_zero:gpu,host" \ |
26 |
| - -DCMAKE_CXX_COMPILER=<PATH_TO_sycl_compiler> \ |
27 |
| - -DSYCL_EXTERNAL_TESTS="RSBench" \ |
28 |
| - .. |
29 |
| -# Build and run full list of SYCL tests |
30 |
| -ninja check |
31 |
| -# Build all tests dependencies |
32 |
| -ninja |
33 |
| -# Run all SYCL tests |
34 |
| -llvm-lit . |
35 |
| -# Get list of available tests |
36 |
| -llvm-lit . --show-tests |
37 |
| -# Run specific test (e.g. RSBench only) |
38 |
| -llvm-lit SYCL/External/RSBench |
39 |
| -# Run tests with parameters |
40 |
| -llvm-lit --param target_devices=host,gpu --param sycl_be=level_zero \ |
41 |
| - --param dpcpp_compiler=path/to/clang++ --param dump_ir=True SYCL/External/RSBench |
42 |
| -``` |
| 7 | +"External" tests directory has necessary infrastructure for running tests where |
| 8 | +sources of tests are expected to be located outside of llvm-test-suite |
| 9 | +repository. Each subdirectory represents external repository for corresponding |
| 10 | +application/test. |
43 | 11 |
|
44 |
| -Notes: |
45 |
| - - it is assumed that LIT framework, FileCheck and other LIT dependencies are |
46 |
| -available in the same directory with llvm-lit. |
| 12 | +# Adding external test |
47 | 13 |
|
48 |
| -# Directory structure |
49 |
| -Every sub-directory (e.g. RSBench) contains the following content: |
| 14 | +See [RSBench](RSBench) as example, it contains the following: |
50 | 15 | * **CMakeLists.txt** - CMake configuration file which is used to obtain
|
51 |
| - application binary and data files. There are several variables which are |
52 |
| - used by it (see [Main parameters](#main-parameters) section for details) |
53 |
| - * **\*.test** - test configuration files, containing command lines, test |
54 |
| - status lines and verification patterns following [LLVM test infrastructure](https://llvm.org/docs/TestingGuide.html). |
| 16 | + application binary and data files. |
55 | 17 | * **lit.local.cfg** - application specific LIT infrastructure configuration
|
56 |
| - file. In case of RSBench benchmarks it sets LIT test file suffixes to `.test` |
| 18 | + file. In case of RSBench benchmark it sets LIT test file suffixes to `.test` |
57 | 19 | and mark all tests in directory unsupported if corresponding directory is
|
58 |
| - not added to `SYCL_EXTERNAL_TESTS` list (benchmark is not included in |
59 |
| - testing). |
| 20 | + not added to `SYCL_EXTERNAL_TESTS` list. See more at: |
| 21 | + [LLVM Testing Guide](https://llvm.org/docs/TestingGuide.html#platform-specific-tests) |
| 22 | + * **\*.test** - test configuration files, containing command lines, test |
| 23 | + status lines and verification patterns per each platform. |
60 | 24 |
|
61 | 25 | # CMake parameters
|
62 |
| -All parameters described in [Readme.md](../README.md#cmake-parameters) are |
63 |
| -applicable. Also extra CMake parameters are introduced to configure specific |
| 26 | + |
| 27 | +All parameters described in [README.md](../README.md#cmake-parameters) are |
| 28 | +applicable. |
| 29 | + |
| 30 | +***SYCL_EXTERNAL_TESTS*** semicolon-separated names of external SYCL |
| 31 | +applications which are built and run as part of the testing. Name is |
| 32 | +subdirectory name in "External" directory. Example: |
| 33 | +``` |
| 34 | +-DSYCL_EXTERNAL_TESTS=RSBench |
| 35 | +``` |
| 36 | +Source code of external application can be downloaded from external repository |
| 37 | +as part of the build or provided in CMake variable <APPNAME>_SRC |
| 38 | +(e.g. RSBench_SRC). |
| 39 | + |
| 40 | +Also extra CMake parameters are introduced to configure specific |
64 | 41 | application:
|
65 |
| - * **APPName_BIN** (e.g. `RSBench_BIN`) - point to the directory containing |
66 |
| - prebuilt binaries of the application. |
67 |
| - * **APPName_SRC** (e.g. `RSBench_SRC`) - point to the directory containing |
68 |
| - sources of the application. |
| 42 | + * **APPName_BIN** (e.g. `RSBench_BIN`) - directory containing prebuilt |
| 43 | + binaries of the application. |
| 44 | + * **APPName_SRC** (e.g. `RSBench_SRC`) - directory containing sources of the |
| 45 | + application. |
69 | 46 | * **APPName_URL** (e.g. `RSBench_URL`) - URL to the GIT repository containing
|
70 |
| - sources of the application (default value for RSBench benchmark is |
71 |
| - `https://github.com/ANL-CESAR/RSBench.git`). |
| 47 | + sources of the application. |
72 | 48 | * **APPName_TAG** (e.g. `RSBench_TAG`) - GIT tag or hash or branch name used
|
73 |
| - to download source from GIT repository (default value for RSBench |
74 |
| - benchmark is `origin/master`). |
| 49 | + to download source from GIT repository. |
| 50 | + |
75 | 51 | Configuration parameters are priorities from top to down. If **APPName_BIN**
|
76 | 52 | is specified binaries will be used directly ignoring other parameters.
|
77 | 53 |
|
78 |
| -# LIT parameters accepted by LIT executor: |
79 |
| -All parameters described in [Readme.md](../README.md#lit-parameters-accepted-by-lit-executor) are applicable. |
| 54 | +# Build and run tests |
| 55 | + |
| 56 | +Get sources |
| 57 | + |
| 58 | +``` |
| 59 | +git clone https://github.com/intel/llvm-test-suite |
| 60 | +cd llvm-test-suite |
| 61 | +mkdir build |
| 62 | +cd build |
| 63 | +``` |
| 64 | + |
| 65 | +With compiler tools available in the PATH: |
| 66 | + |
| 67 | +``` |
| 68 | +# Configure |
| 69 | +cmake \ |
| 70 | + -DCMAKE_CXX_COMPILER=clang++ \ |
| 71 | + -DTEST_SUITE_SUBDIRS=SYCL \ |
| 72 | + -DCHECK_SYCL_ALL="level_zero:gpu" \ |
| 73 | + -DSYCL_EXTERNAL_TESTS="RSBench" \ |
| 74 | + .. |
| 75 | +
|
| 76 | +# Build and Run |
| 77 | +make check-sycl-all |
| 78 | +
|
| 79 | +``` |
80 | 80 |
|
81 |
| -# LIT features which can be used to configure test execution: |
82 |
| -All features described in [Readme.md](../README.md#lit-features-which-can-be-used-to-configure-test-execution) are applicable. |
0 commit comments