Skip to content

[NFCI] Introduce <sycl/detail/core.hpp> include #12890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions sycl/include/sycl/detail/core.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//==------------ sycl.hpp - SYCL2020 standard header file ------------------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#pragma once

// This is an ongoing experimental activity in its early stage. No code outside
// this project must rely on the behavior of this header file - keep using
// <sycl/sycl.hpp>.
//
// Short-term plan/action items (in no particular order):
// * Update more tests to use this instead of full <sycl/sycl.hpp>.
// * Refactor includes so that transitive dependencies don't bring as much as
// they currently do.
// * Determine what else should be included here.

#include <sycl/accessor.hpp>
#include <sycl/buffer.hpp>
#include <sycl/queue.hpp>
1 change: 0 additions & 1 deletion sycl/include/sycl/ext/oneapi/experimental/root_group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#pragma once

#include <sycl/builtins.hpp>
#include <sycl/ext/oneapi/properties/properties.hpp>
#include <sycl/group.hpp>
#include <sycl/memory_enums.hpp>
Expand Down
5 changes: 2 additions & 3 deletions sycl/include/sycl/sycl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

#pragma once

#include <sycl/accessor.hpp>
#include <sycl/detail/core.hpp>

#include <sycl/aspects.hpp>
#include <sycl/atomic.hpp>
#include <sycl/atomic_fence.hpp>
Expand All @@ -17,7 +18,6 @@
#if SYCL_BACKEND_OPENCL
#include <sycl/backend/opencl.hpp>
#endif
#include <sycl/buffer.hpp>
#include <sycl/builtins.hpp>
#include <sycl/context.hpp>
#include <sycl/define_vendors.hpp>
Expand Down Expand Up @@ -47,7 +47,6 @@
#include <sycl/platform.hpp>
#include <sycl/pointers.hpp>
#include <sycl/properties/all_properties.hpp>
#include <sycl/queue.hpp>
#include <sycl/range.hpp>
#include <sycl/reduction.hpp>
#include <sycl/sampler.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "Inputs/kernels_in_file2.hpp"
#include <cstdio>
#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>
#include <thread>

#ifdef DEFINE_NDEBUG_INFILE1
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/AsyncHandler/default_async_handler.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out &> %t.txt ; FileCheck %s --input-file %t.txt

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

using namespace sycl;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/BFloat16/bfloat16_conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//===---------------------------------------------------------------------===//

#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

using namespace sycl;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/BFloat16/bfloat_hw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <cstdint>
#include <type_traits>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/AMX_aspect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//===----------------------------------------------------------------------===//

#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

using namespace sycl;
using arch = sycl::ext::oneapi::experimental::architecture;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/access_to_subset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//
//===----------------------------------------------------------------------===//
#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

using namespace sycl;
using acc_w = accessor<int, 2, access::mode::write, access::target::device>;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/accessor/empty_acc_host_task.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

int main() {
sycl::queue q;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/accessor/empty_zero_dim_accessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

using namespace sycl;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/alloc_pinned_host_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// RUN: env SYCL_PI_TRACE=2 UR_L0_DEBUG=1 %{run} %t2.out %if level_zero %{ 2>&1 | FileCheck %s %}
// RUN: %{run} %t2.out

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <cassert>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/aspects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//===----------------------------------------------------------------------===//

#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

using namespace sycl;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/bit_cast/bit_cast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// RUN: %if windows %{ %clangxx -fsycl -fsycl-host-compiler=cl -fsycl-host-compiler-options='/std:c++17 /Zc:__cplusplus' -o %t2.out %s %}
// RUN: %if windows %{ %{run} %t2.out %}

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <iostream>
#include <math.h>
Expand Down
5 changes: 4 additions & 1 deletion sycl/test-e2e/Basic/boolean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
// RUN: %{run} %t.out
#include <cassert>
#include <iostream>
#include <sycl/sycl.hpp>

#include <sycl/detail/core.hpp>

#include <sycl/detail/boolean.hpp>

using namespace sycl;
namespace s = sycl;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/buffer/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <cassert>
#include <iostream>
#include <memory>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

using namespace sycl;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/buffer/buffer_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// device.

#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

constexpr size_t NumElems = 67;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/buffer/buffer_container.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %{build} %cxx_std_optionc++17 -o %t2.out
// RUN: %{run} %t2.out

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

using namespace sycl;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/buffer/buffer_create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// UNSUPPORTED: ze_debug

#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

using namespace sycl;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/buffer/buffer_dev_to_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <cassert>
#include <memory>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

using namespace sycl;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/buffer/buffer_full_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <cassert>
#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

void check_copy_device_to_host(sycl::queue &Queue) {
constexpr int size = 6, offset = 2;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/buffer/buffer_migrate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>
using namespace sycl;

int main() {
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/buffer/reinterpret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <climits>
#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

// This tests verifies basic cases of using sycl::buffer::reinterpret
// functionality - changing buffer type and range. This test checks that
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/buffer/subbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// 1) Correct results after usage of different type of accessors to sub buffer
// 2) Exceptions if we trying to create sub buffer not according to spec

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <algorithm>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/buffer/subbuffer_overlap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %{run} %t.out
// RUN: env SYCL_PI_TRACE=-1 %{run} %t.out 2>&1 | FileCheck %s

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

int main() {
sycl::queue q;
Expand Down
4 changes: 3 additions & 1 deletion sycl/test-e2e/Basic/built-ins/helpers.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <sycl/builtins.hpp>

template <typename T, typename D> bool equal(T x, T y, D delta) {
// Maybe should be C++20's std::equality_comparable.
Expand Down
4 changes: 3 additions & 1 deletion sycl/test-e2e/Basic/built-ins/marray_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
// RUN: %if preview-breaking-changes-supported %{ %{run} %t_preview.out%}

#include <cmath>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <sycl/builtins.hpp>

// Reference
// https://github.com/KhronosGroup/SYCL-CTS/blob/SYCL-2020/util/accuracy.h
Expand Down
4 changes: 3 additions & 1 deletion sycl/test-e2e/Basic/built-ins/vec_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#endif
#include <cmath>

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <sycl/builtins.hpp>

#define TEST(FUNC, VEC_ELEM_TYPE, DIM, EXPECTED, DELTA, ...) \
{ \
Expand Down
4 changes: 3 additions & 1 deletion sycl/test-e2e/Basic/built-ins/vec_geometric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %}
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <sycl/builtins.hpp>

#define TEST(FUNC, VEC_ELEM_TYPE, DIM, EXPECTED, DELTA, ...) \
{ \
Expand Down
4 changes: 3 additions & 1 deletion sycl/test-e2e/Basic/built-ins/vec_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes %{mathflags} -o %t2.out %}
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <sycl/builtins.hpp>

#define TEST(FUNC, VEC_ELEM_TYPE, DIM, EXPECTED, DELTA, ...) \
{ \
Expand Down
4 changes: 3 additions & 1 deletion sycl/test-e2e/Basic/built-ins/vec_relational.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// RUN: %if preview-breaking-changes-supported %{ %{build} -fpreview-breaking-changes -o %t2.out %}
// RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %}

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

#include <sycl/builtins.hpp>

#define TEST(FUNC, TYPE, EXPECTED, N, ...) \
{ \
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/compare_exchange_strong.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>
using namespace sycl;

int main() {
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/context_platforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %{run-unfiltered-devices} %t.out

#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

using namespace sycl;

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/default_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

int main() {
sycl::device Dev;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/default_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// RUN: %{build} -o %t.out
// RUN: %{run} %t.out

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

int main() {
sycl::platform Plt;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/device-selectors.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %{build} -o %t.out -DSYCL_DISABLE_IMAGE_ASPECT_WARNING
// RUN: %{run-unfiltered-devices} %t.out

#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>
using namespace sycl;

auto exception_handler_lambda = [](exception_list elist) {
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <cassert>
#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>
#include <utility>

using namespace sycl;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/device_equality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <cassert>
#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>
#include <utility>

using namespace sycl;
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Basic/diagnostics/device-check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//==---------------------------------------------------------------==//

#include <iostream>
#include <sycl/sycl.hpp>
#include <sycl/detail/core.hpp>

using namespace sycl;

Expand Down
Loading