Skip to content

Commit a2be420

Browse files
fabiomestreBensuo
andauthored
[SYCL][Graph] Add documentation for layout of graph e2e tests (#13251)
Co-authored-by: Ben Tracy <[email protected]>
1 parent 9861f58 commit a2be420

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

sycl/test-e2e/Graph/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Overview
2+
3+
The "Graph" directory contains tests for the
4+
[sycl_ext_oneapi_graph](../../doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc)
5+
extension.
6+
7+
Many subdirectories contain a `lit.local.cfg` file. This file sets the `lit`
8+
option `config.required_features` to the graph aspect required to run the tests:
9+
10+
- `aspect-ext_oneapi_limited_graph` for any test that doesn't require the
11+
executable graph update feature.
12+
- `aspect-ext_oneapi_graph` for any test that does require the executable graph
13+
update feature.
14+
15+
## Structure
16+
17+
Most of the tests are written in a similar manner to other `e2e` tests. The
18+
exception to this are tests in the `Inputs` directory which are meant to be used
19+
as inputs to other tests.
20+
21+
Often, the same feature, needs to be tested for both the `Explicit`
22+
and `Record and Replay` APIs. To avoid code duplication, such tests are added to
23+
the `Inputs` folder and rely on common code from `graph_common.hpp` to construct
24+
the graph. The files in the `Inputs` directory are not run directly by `lit`.
25+
Instead, that source is included by tests in the `Explicit` and `RecordReplay`
26+
directories. These tests also define `GRAPH_E2E_EXPLICIT`
27+
or `GRAPH_E2E_RECORD_REPLAY` respectively to choose which API is used by the
28+
common code.
29+
30+
The other directories are used to group similar tests together. Tests that
31+
require a specific `aspect` are also grouped together in order to use the
32+
`lit.local.cfg` file. Directories might themselves contain subdirectories named
33+
`Explicit` and `RecordReplay` if they make use of the framework described above.
34+
35+
In addition, in order to help identify specific tests, the matching files
36+
in `Explicit`, `RecordReplay` and `Inputs` folders should have identical names.
37+
38+
## Test Execution
39+
40+
Tests might be run multiple times using different options. The most commonly used
41+
options are:
42+
43+
- `l0_leak_check`: `lit` substitution which, on the `level-zero` backend, enables
44+
checks for memory leaks caused by mismatched number of calls to memory
45+
allocation / release APIs in `Unified Runtime`.
46+
- `SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS`: Environment variable which,
47+
on the `level-zero` backend, enables or disables
48+
[immediate command-lists](https://spec.oneapi.io/level-zero/latest/core/PROG.html#low-latency-immediate-command-lists).
49+
Without this option, depending on the hardware, immediate command-lists might be
50+
enabled or disabled by default.
51+
52+
Tests might be run multiple times using different combination of the options
53+
described above. Most tests do the following:
54+
55+
1. A default run which runs for all backends.
56+
2. On the `level-zero` backend only, tests for leaks and forcefully **disables**
57+
immediate command-lists in order to test this codepath on hardware that enables
58+
immediate command-lists by default.
59+
3. On the `level-zero` backend only, tests for leaks and forcefully **enables**
60+
immediate command-lists in order to test this codepath on hardware that disables
61+
immediate command-lists by default.

0 commit comments

Comments
 (0)