Skip to content

Commit b7501ae

Browse files
[NFCI] Introduce <sycl/detail/core.hpp> include (#12890)
The idea is to have a thinner version of `<sycl/sycl.hpp>` that allows to run basic tests and enables fine-grained includes in our e2e tests. Hopefully that can increase CI efficiency.
1 parent 710fd87 commit b7501ae

File tree

286 files changed

+377
-291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+377
-291
lines changed

sycl/include/sycl/detail/core.hpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//==------------ sycl.hpp - SYCL2020 standard header file ------------------==//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#pragma once
10+
11+
// This is an ongoing experimental activity in its early stage. No code outside
12+
// this project must rely on the behavior of this header file - keep using
13+
// <sycl/sycl.hpp>.
14+
//
15+
// Short-term plan/action items (in no particular order):
16+
// * Update more tests to use this instead of full <sycl/sycl.hpp>.
17+
// * Refactor includes so that transitive dependencies don't bring as much as
18+
// they currently do.
19+
// * Determine what else should be included here.
20+
21+
#include <sycl/accessor.hpp>
22+
#include <sycl/buffer.hpp>
23+
#include <sycl/queue.hpp>

sycl/include/sycl/ext/oneapi/experimental/root_group.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#pragma once
1010

11-
#include <sycl/builtins.hpp>
1211
#include <sycl/ext/oneapi/properties/properties.hpp>
1312
#include <sycl/group.hpp>
1413
#include <sycl/memory_enums.hpp>

sycl/include/sycl/sycl.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
#pragma once
1010

11-
#include <sycl/accessor.hpp>
11+
#include <sycl/detail/core.hpp>
12+
1213
#include <sycl/aspects.hpp>
1314
#include <sycl/atomic.hpp>
1415
#include <sycl/atomic_fence.hpp>
@@ -17,7 +18,6 @@
1718
#if SYCL_BACKEND_OPENCL
1819
#include <sycl/backend/opencl.hpp>
1920
#endif
20-
#include <sycl/buffer.hpp>
2121
#include <sycl/builtins.hpp>
2222
#include <sycl/context.hpp>
2323
#include <sycl/define_vendors.hpp>
@@ -47,7 +47,6 @@
4747
#include <sycl/platform.hpp>
4848
#include <sycl/pointers.hpp>
4949
#include <sycl/properties/all_properties.hpp>
50-
#include <sycl/queue.hpp>
5150
#include <sycl/range.hpp>
5251
#include <sycl/reduction.hpp>
5352
#include <sycl/sampler.hpp>

sycl/test-e2e/Assert/assert_in_simultaneously_multiple_tus.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "Inputs/kernels_in_file2.hpp"
3232
#include <cstdio>
3333
#include <iostream>
34-
#include <sycl/sycl.hpp>
34+
#include <sycl/detail/core.hpp>
3535
#include <thread>
3636

3737
#ifdef DEFINE_NDEBUG_INFILE1

sycl/test-e2e/AsyncHandler/default_async_handler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out &> %t.txt ; FileCheck %s --input-file %t.txt
33

4-
#include <sycl/sycl.hpp>
4+
#include <sycl/detail/core.hpp>
55

66
using namespace sycl;
77

sycl/test-e2e/BFloat16/bfloat16_conversions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//===---------------------------------------------------------------------===//
1818

1919
#include <iostream>
20-
#include <sycl/sycl.hpp>
20+
#include <sycl/detail/core.hpp>
2121

2222
using namespace sycl;
2323

sycl/test-e2e/BFloat16/bfloat_hw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// "Hello world" bfloat16 test which checks conversion algorithms on host.
55

6-
#include <sycl/sycl.hpp>
6+
#include <sycl/detail/core.hpp>
77

88
#include <cstdint>
99
#include <type_traits>

sycl/test-e2e/Basic/AMX_aspect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//===----------------------------------------------------------------------===//
1616

1717
#include <iostream>
18-
#include <sycl/sycl.hpp>
18+
#include <sycl/detail/core.hpp>
1919

2020
using namespace sycl;
2121
using arch = sycl::ext::oneapi::experimental::architecture;

sycl/test-e2e/Basic/access_to_subset.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111
#include <iostream>
12-
#include <sycl/sycl.hpp>
12+
#include <sycl/detail/core.hpp>
1313

1414
using namespace sycl;
1515
using acc_w = accessor<int, 2, access::mode::write, access::target::device>;

sycl/test-e2e/Basic/accessor/empty_acc_host_task.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out
3-
#include <sycl/sycl.hpp>
3+
#include <sycl/detail/core.hpp>
44

55
int main() {
66
sycl::queue q;

sycl/test-e2e/Basic/accessor/empty_zero_dim_accessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// Tests the size and iterator members of an empty zero-dimensional accessor.
55

6-
#include <sycl/sycl.hpp>
6+
#include <sycl/detail/core.hpp>
77

88
using namespace sycl;
99

sycl/test-e2e/Basic/alloc_pinned_host_memory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: env SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t2.out %if level_zero %{ 2>&1 | FileCheck %s %}
55
// RUN: %{run} %t2.out
66

7-
#include <sycl/sycl.hpp>
7+
#include <sycl/detail/core.hpp>
88

99
#include <cassert>
1010
#include <string>

sycl/test-e2e/Basic/aspects.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//===----------------------------------------------------------------------===//
1616

1717
#include <iostream>
18-
#include <sycl/sycl.hpp>
18+
#include <sycl/detail/core.hpp>
1919

2020
using namespace sycl;
2121

sycl/test-e2e/Basic/bit_cast/bit_cast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %if windows %{ %clangxx -fsycl -fsycl-host-compiler=cl -fsycl-host-compiler-options='/std:c++17 /Zc:__cplusplus' -o %t2.out %s %}
44
// RUN: %if windows %{ %{run} %t2.out %}
55

6-
#include <sycl/sycl.hpp>
6+
#include <sycl/detail/core.hpp>
77

88
#include <iostream>
99
#include <math.h>

sycl/test-e2e/Basic/boolean.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
// RUN: %{run} %t.out
33
#include <cassert>
44
#include <iostream>
5-
#include <sycl/sycl.hpp>
5+
6+
#include <sycl/detail/core.hpp>
7+
8+
#include <sycl/detail/boolean.hpp>
69

710
using namespace sycl;
811
namespace s = sycl;

sycl/test-e2e/Basic/buffer/buffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <cassert>
1313
#include <iostream>
1414
#include <memory>
15-
#include <sycl/sycl.hpp>
15+
#include <sycl/detail/core.hpp>
1616

1717
using namespace sycl;
1818

sycl/test-e2e/Basic/buffer/buffer_allocator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// device.
1515

1616
#include <iostream>
17-
#include <sycl/sycl.hpp>
17+
#include <sycl/detail/core.hpp>
1818

1919
constexpr size_t NumElems = 67;
2020

sycl/test-e2e/Basic/buffer/buffer_container.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %{build} %cxx_std_optionc++17 -o %t2.out
22
// RUN: %{run} %t2.out
33

4-
#include <sycl/sycl.hpp>
4+
#include <sycl/detail/core.hpp>
55

66
using namespace sycl;
77

sycl/test-e2e/Basic/buffer/buffer_create.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// UNSUPPORTED: ze_debug
55

66
#include <iostream>
7-
#include <sycl/sycl.hpp>
7+
#include <sycl/detail/core.hpp>
88

99
using namespace sycl;
1010

sycl/test-e2e/Basic/buffer/buffer_dev_to_dev.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include <cassert>
1515
#include <memory>
16-
#include <sycl/sycl.hpp>
16+
#include <sycl/detail/core.hpp>
1717

1818
using namespace sycl;
1919

sycl/test-e2e/Basic/buffer/buffer_full_copy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include <cassert>
1313
#include <iostream>
14-
#include <sycl/sycl.hpp>
14+
#include <sycl/detail/core.hpp>
1515

1616
void check_copy_device_to_host(sycl::queue &Queue) {
1717
constexpr int size = 6, offset = 2;

sycl/test-e2e/Basic/buffer/buffer_migrate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#include <iostream>
10-
#include <sycl/sycl.hpp>
10+
#include <sycl/detail/core.hpp>
1111
using namespace sycl;
1212

1313
int main() {

sycl/test-e2e/Basic/buffer/reinterpret.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include <climits>
1515
#include <iostream>
16-
#include <sycl/sycl.hpp>
16+
#include <sycl/detail/core.hpp>
1717

1818
// This tests verifies basic cases of using sycl::buffer::reinterpret
1919
// functionality - changing buffer type and range. This test checks that

sycl/test-e2e/Basic/buffer/subbuffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// 1) Correct results after usage of different type of accessors to sub buffer
1717
// 2) Exceptions if we trying to create sub buffer not according to spec
1818

19-
#include <sycl/sycl.hpp>
19+
#include <sycl/detail/core.hpp>
2020

2121
#include <algorithm>
2222
#include <iostream>

sycl/test-e2e/Basic/buffer/subbuffer_overlap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run} %t.out
33
// RUN: env SYCL_PI_TRACE=-1 %{run} %t.out 2>&1 | FileCheck %s
44

5-
#include <sycl/sycl.hpp>
5+
#include <sycl/detail/core.hpp>
66

77
int main() {
88
sycl::queue q;

sycl/test-e2e/Basic/built-ins/helpers.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#include <sycl/sycl.hpp>
1+
#include <sycl/detail/core.hpp>
2+
3+
#include <sycl/builtins.hpp>
24

35
template <typename T, typename D> bool equal(T x, T y, D delta) {
46
// Maybe should be C++20's std::equality_comparable.

sycl/test-e2e/Basic/built-ins/marray_math.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
// RUN: %if preview-breaking-changes-supported %{ %{run} %t_preview.out%}
77

88
#include <cmath>
9-
#include <sycl/sycl.hpp>
9+
#include <sycl/detail/core.hpp>
10+
11+
#include <sycl/builtins.hpp>
1012

1113
// Reference
1214
// https://github.com/KhronosGroup/SYCL-CTS/blob/SYCL-2020/util/accuracy.h

sycl/test-e2e/Basic/built-ins/vec_common.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
#endif
99
#include <cmath>
1010

11-
#include <sycl/sycl.hpp>
11+
#include <sycl/detail/core.hpp>
12+
13+
#include <sycl/builtins.hpp>
1214

1315
#define TEST(FUNC, VEC_ELEM_TYPE, DIM, EXPECTED, DELTA, ...) \
1416
{ \

sycl/test-e2e/Basic/built-ins/vec_geometric.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %}
44
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
55

6-
#include <sycl/sycl.hpp>
6+
#include <sycl/detail/core.hpp>
7+
8+
#include <sycl/builtins.hpp>
79

810
#define TEST(FUNC, VEC_ELEM_TYPE, DIM, EXPECTED, DELTA, ...) \
911
{ \

sycl/test-e2e/Basic/built-ins/vec_math.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes %{mathflags} -o %t2.out %}
66
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
77

8-
#include <sycl/sycl.hpp>
8+
#include <sycl/detail/core.hpp>
9+
10+
#include <sycl/builtins.hpp>
911

1012
#define TEST(FUNC, VEC_ELEM_TYPE, DIM, EXPECTED, DELTA, ...) \
1113
{ \

sycl/test-e2e/Basic/built-ins/vec_relational.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %}
44
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}
55

6-
#include <sycl/sycl.hpp>
6+
#include <sycl/detail/core.hpp>
7+
8+
#include <sycl/builtins.hpp>
79

810
#define TEST(FUNC, TYPE, EXPECTED, N, ...) \
911
{ \

sycl/test-e2e/Basic/compare_exchange_strong.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %{build} -o %t.out
22
// RUN: %{run} %t.out
33

4-
#include <sycl/sycl.hpp>
4+
#include <sycl/detail/core.hpp>
55
using namespace sycl;
66

77
int main() {

sycl/test-e2e/Basic/context_platforms.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run-unfiltered-devices} %t.out
33

44
#include <iostream>
5-
#include <sycl/sycl.hpp>
5+
#include <sycl/detail/core.hpp>
66

77
using namespace sycl;
88

sycl/test-e2e/Basic/default_device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// RUN: %{build} -o %t.out
1010
// RUN: %{run} %t.out
1111

12-
#include <sycl/sycl.hpp>
12+
#include <sycl/detail/core.hpp>
1313

1414
int main() {
1515
sycl::device Dev;

sycl/test-e2e/Basic/default_platform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// RUN: %{build} -o %t.out
1010
// RUN: %{run} %t.out
1111

12-
#include <sycl/sycl.hpp>
12+
#include <sycl/detail/core.hpp>
1313

1414
int main() {
1515
sycl::platform Plt;

sycl/test-e2e/Basic/device-selectors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %{build} -o %t.out -DSYCL_DISABLE_IMAGE_ASPECT_WARNING
22
// RUN: %{run-unfiltered-devices} %t.out
33

4-
#include <sycl/sycl.hpp>
4+
#include <sycl/detail/core.hpp>
55
using namespace sycl;
66

77
auto exception_handler_lambda = [](exception_list elist) {

sycl/test-e2e/Basic/device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <cassert>
77
#include <iostream>
8-
#include <sycl/sycl.hpp>
8+
#include <sycl/detail/core.hpp>
99
#include <utility>
1010

1111
using namespace sycl;

sycl/test-e2e/Basic/device_equality.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include <cassert>
1313
#include <iostream>
14-
#include <sycl/sycl.hpp>
14+
#include <sycl/detail/core.hpp>
1515
#include <utility>
1616

1717
using namespace sycl;

sycl/test-e2e/Basic/diagnostics/device-check.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//==---------------------------------------------------------------==//
1919

2020
#include <iostream>
21-
#include <sycl/sycl.hpp>
21+
#include <sycl/detail/core.hpp>
2222

2323
using namespace sycl;
2424

0 commit comments

Comments
 (0)