@@ -62,21 +62,37 @@ Every product change should be accompanied with corresponding test modification
62
62
(adding new test(s), extending, removing or modifying existing test(s)).
63
63
64
64
There are 3 types of tests which are used for DPC++ toolchain validation:
65
- * DPC++ in-tree LIT tests including [check-llvm](../../ llvm/test),
66
- [check-clang](../../ clang/test), [check-llvm-spirv](../../ llvm-spirv/test) and
67
- [check-sycl](../../ sycl/test) targets stored in this repository. These tests
65
+ * DPC++ in-tree tests including [check-llvm](llvm/test),
66
+ [check-clang](clang/test), [check-llvm-spirv](llvm-spirv/test) and
67
+ [check-sycl](sycl/test) targets stored in this repository. These tests
68
68
should not have hardware (e.g. GPU, FPGA, etc.) or external software
69
69
dependencies (e.g. OpenCL, Level Zero, CUDA runtimes). All tests not following
70
70
this approach should be moved to DPC++ end-to-end or SYCL-CTS tests.
71
+ Generally, any functional change to any of the DPC++ toolchain components
72
+ should be accompanied by one or more tests of this type when possible. They
73
+ allow verifying individual components and tend to be more lightweight than
74
+ end-to-end or SYCL-CTS tests.
75
+
76
+ ** General guidelines for adding DPC++ in-tree tests** :
71
77
72
- ** Guidelines for adding DPC++ in-tree LIT tests (DPC++ Clang FE tests)** :
73
78
- Use ` sycl::` namespace instead of ` cl::sycl::`
74
79
80
+ - Add a helpful comment describing what the test does at the beginning and
81
+ other comments throughout the test as necessary.
82
+
83
+ - Try to follow descriptive naming convention for variables, functions as
84
+ much as possible.
85
+ Please refer to
86
+ [LLVM naming convention](https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly)
87
+
88
+ ** DPC++ clang FE tests** :
89
+
75
90
- Include sycl mock headers as system headers.
76
91
Example: ` -internal-isystem %S/Inputs`
77
92
` # include "sycl.hpp"`
78
93
79
- - Use SYCL functions for invoking kernels from the mock header ` (single_task, parallel_for, parallel_for_work_group)`
94
+ - Use SYCL functions for invoking kernels from the mock header
95
+ ` (single_task, parallel_for, parallel_for_work_group)`
80
96
Example:
81
97
` ` ` bash
82
98
` # include "Inputs/sycl.hpp"`
@@ -86,10 +102,14 @@ this approach should be moved to DPC++ end-to-end or SYCL-CTS tests.
86
102
});
87
103
` ` `
88
104
89
- - Add a helpful comment describing what the test does at the beginning and other comments throughout the test as necessary.
105
+ ** DPC++ headers and runtime tests ** :
90
106
91
- - Try to follow descriptive naming convention for variables, functions as much as possible.
92
- Please refer [LLVM naming convention](https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly)
107
+ - [check-sycl](sycl/test) target contains 2 types of tests: LIT tests and
108
+ unit tests. LIT tests make compile-time checks of DPC++ headers, e.g. device
109
+ code IR verification, static_assert tests. Unit tests check DPC++ runtime
110
+ behavior and do not perform any device code compilation, instead relying on
111
+ redefining plugin API with [PiMock](sycl/unittests/helpers/PiMock.hpp) when
112
+ necessary.
93
113
94
114
* DPC++ end-to-end (E2E) tests which are extension to
95
115
[LLVM\* test suite](https://github.com/intel/llvm-test-suite/tree/intel/SYCL).
0 commit comments