Skip to content

Commit 006d4e7

Browse files
committed
[SYCL][Test] Track amount of inter-dependencies between headers
To improve compile-time, we may one day split `sycl/sycl.hpp` into separate headers, but we need to make sure that those headers don't include every other header so that there is an actual benefit of using them. This PR introduced a test to track that certain headers which we already consider isolated are not used from anywhere else except from `sycl/sycl.hpp`. Note that for now we allow extension headers to include everything and only focusing on the core SYCL headers.
1 parent 530354f commit 006d4e7

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// sycl/sycl.hpp is a very heavy header, because it includes all SYCL feature.
2+
//
3+
// In order to be able to split it, we need to make sure that all
4+
// inter-dependencies between headers are resolved. We already have a set of
5+
// tests which make sure that every header can be compiled if included alone,
6+
// but to achieve that, every header can simply include every other header.
7+
//
8+
// Considering that the main reason for sycl.hpp splitting is compilation time
9+
// improvement, it is important that SYCL headers do not include each other
10+
// unnecessary to make sure that when you include a single specific header, you
11+
// only get specific functionality and nothing extra.
12+
//
13+
// Note that this test ignores "ext" subfolder for now and concentrates on
14+
// core SYCL functionality for now.
15+
//
16+
// REQUIRES: linux
17+
//
18+
// RUN: grep -rl "#include <sycl/sub_group.hpp>" %sycl_include/sycl \
19+
// RUN: --exclude-dir=*ext* | FileCheck %s --check-prefix=SUB-GROUP
20+
// SUB-GROUP: sycl/sycl.hpp
21+
// SUB-GROUP-EMPTY:
22+
//
23+
// RUN: grep -rl "#include <sycl/stream.hpp>" %sycl_include/sycl \
24+
// RUN: --exclude-dir=*ext* | FileCheck %s --check-prefix=STREAM
25+
// STREAM: sycl/sycl.hpp
26+
// STREAM-EMPTY:
27+

0 commit comments

Comments
 (0)