@@ -54,6 +54,63 @@ see [ABI Policy Guide](sycl/doc/ABIPolicyGuide.md) for more information.
54
54
- Run regression tests -
55
55
[instructions](sycl/doc/GetStartedGuide.md#test-dpc-toolchain).
56
56
57
+ # ## Tests development
58
+
59
+ Every product change should be accompanied with corresponding test modification
60
+ (adding new test(s), extending, removing or modifying existing test(s)).
61
+
62
+ There are 3 types of tests which are used for DPC++ toolchain validation:
63
+ * DPC++ in-tree LIT tests including [check-llvm](../../llvm/test),
64
+ [check-clang](../../clang/test), [check-llvm-spirv](../../llvm-spirv/test) and
65
+ [check-sycl](../../sycl/test) targets stored in this repository. These tests
66
+ should not have hardware (e.g. GPU, FPGA, etc.) or external software
67
+ dependencies (e.g. OpenCL, Level Zero, CUDA runtimes). All tests not following
68
+ this approach should be moved to DPC++ end-to-end or SYCL-CTS tests.
69
+ However, the tests for a feature under active development requiring atomic
70
+ change for tests and product can be put to
71
+ [sycl/test/on-device](../../sycl/test/on-device) temporarily. It is developer
72
+ responsibility to move the tests to DPC++ E2E test suite or SYCL-CTS once
73
+ the feature is stabilized.
74
+
75
+ ** Guidelines for adding DPC++ in-tree LIT tests (DPC++ Clang FE tests)** :
76
+ - Use ` sycl::` namespace instead of ` cl::sycl::`
77
+
78
+ - Include sycl mock headers as system headers.
79
+ Example: ` -internal-isystem %S/Inputs`
80
+ ` # include "sycl.hpp"`
81
+
82
+ - Use SYCL functions for invoking kernels from the mock header ` (single_task, parallel_for, parallel_for_work_group)`
83
+ Example:
84
+ ` ` ` bash
85
+ ` # include "Inputs/sycl.hpp"`
86
+ sycl::queue q;
87
+ q.submit([& ](cl::sycl::handler & h) {
88
+ h.single_task( { //code });
89
+ });
90
+ ` ` `
91
+
92
+ - Add a helpful comment describing what the test does at the beginning and other comments throughout the test as necessary.
93
+
94
+ - Try to follow descriptive naming convention for variables, functions as much as possible.
95
+ Please refer [LLVM naming convention](https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly)
96
+
97
+ * DPC++ end-to-end (E2E) tests which are extension to
98
+ [LLVM\* test suite](https://github.com/intel/llvm-test-suite/tree/intel/SYCL).
99
+ A test which requires full stack including backend runtimes (e.g. OpenCL,
100
+ Level Zero or CUDA) should be put to DPC++ E2E test suite following
101
+ [CONTRIBUTING](https://github.com/intel/llvm-test-suite/blob/intel/CONTRIBUTING.md).
102
+
103
+ * SYCL-CTS are official
104
+ [Khronos\* SYCL\* conformance tests](https://github.com/KhronosGroup/SYCL-CTS).
105
+ They verify SYCL specification compatibility. All implementation details or
106
+ extensions are out of scope for the tests. If SYCL specification has changed
107
+ (SYCL CTS tests conflict with recent version of SYCL specification) or change
108
+ is required in the way the tests are built with DPC++ compiler (defined in
109
+ [FindIntel_SYCL](https://github.com/KhronosGroup/SYCL-CTS/blob/SYCL-1.2.1/master/cmake/FindIntel_SYCL.cmake))
110
+ pull request should be created under
111
+ [KhronosGroup/SYCL-CTS](https://github.com/KhronosGroup/SYCL-CTS) with required
112
+ patch.
113
+
57
114
# ## Commit message
58
115
59
116
- When writing your commit message, please make sure to follow
0 commit comments