Skip to content

[SYCL][NFC] Update includes in DPC++ headers. #10648

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 37 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
572dba8
Apply include what you use.
bader Aug 1, 2023
72062c5
Fix includes with regexp.
bader Aug 1, 2023
d091a16
More include fixes.
bader Aug 1, 2023
3670bf2
Revert some pi.hpp changes.
bader Aug 1, 2023
ee81e22
Revert some changes in include/sycl/ext/intel/esimd/emu/detail/esimd_…
bader Aug 1, 2023
50089f3
Revert some changes in include/sycl/detail/common.hpp.
bader Aug 1, 2023
941e9a6
Revert some changes in include/sycl/exception_list.hpp.
bader Aug 1, 2023
e2e14da
Revert some changes in sycl/include/CL/__spirv/spirv_types.hpp.
bader Aug 1, 2023
9f84ee3
Revert some changes in sycl/include/sycl/access/access.hpp.
bader Aug 1, 2023
e96e10a
revert some changes.
bader Aug 2, 2023
d8b52ba
Fixes.
bader Aug 2, 2023
ea28d65
more fixes
bader Aug 2, 2023
ed32a29
Apply clang-format.
bader Aug 2, 2023
80bcf76
Merge remote-tracking branch 'intel/sycl' into iwyu-full
bader Aug 2, 2023
54d3c76
Fix compilation for NVPTX target.
bader Aug 2, 2023
c420405
Recover includes for device code.
bader Aug 2, 2023
e0739e4
Check that __has_builtin is defined before using it.
bader Aug 2, 2023
5f71786
Sort includes in CL/__spirv headers.
bader Aug 2, 2023
c89a6ea
Sort includes in opencl.hpp.
bader Aug 2, 2023
4dffb48
Remove unnecessary headers.
bader Aug 2, 2023
457b3d0
Sort includes in usm_allocator.hpp and include usm_allocator.hpp to s…
bader Aug 2, 2023
ef86ee7
Include nd_item.hpp and sort includes in group_algorithm.hpp
bader Aug 2, 2023
9002169
Include extension headers to sycl.hpp
bader Aug 2, 2023
e4113ec
Apply clang-format.
bader Aug 2, 2023
cb73492
Apply clang-format.
bader Aug 3, 2023
b3a47a8
Fix build with MSVC.
bader Aug 3, 2023
975f097
Don't declare empty namespaces.
bader Aug 3, 2023
aca1370
Sort includes.
bader Aug 3, 2023
c227a42
Sort includes.
bader Aug 3, 2023
9d6d9ac
Remove unused(?) include.
bader Aug 3, 2023
74fa1c6
Add group_barrier.hpp include to sycl/sycl.hpp
bader Aug 3, 2023
29689db
Sort includes.
bader Aug 3, 2023
23b71cc
Apply clang-format.
bader Aug 3, 2023
00a83b9
Fix bit_cast.
bader Aug 3, 2023
30397fe
version header is supported by C++20 or later.
bader Aug 3, 2023
efb99d2
Fix opencl header include.
bader Aug 3, 2023
9ae6898
Remove duplicate include.
bader Aug 3, 2023
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
9 changes: 6 additions & 3 deletions sycl/include/CL/__spirv/spirv_ops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@

#pragma once

#include <CL/__spirv/spirv_types.hpp>
#include <sycl/detail/defines_elementary.hpp>
#include <sycl/detail/export.hpp>
#include <CL/__spirv/spirv_types.hpp> // for Scope, __ocl_event_t
#include <sycl/detail/defines_elementary.hpp> // for __DPCPP_SYCL_EXTERNAL
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT

#include <stddef.h> // for size_t
#include <stdint.h> // for uint32_t

// Convergent attribute
#ifdef __SYCL_DEVICE_ONLY__
Expand Down
10 changes: 5 additions & 5 deletions sycl/include/CL/__spirv/spirv_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

#pragma once

#include <sycl/detail/defines_elementary.hpp>
#include <sycl/half_type.hpp>
#include <sycl/detail/defines.hpp> // for SYCL_EXT_ONEAPI_MATRIX_VERSION
#include <sycl/half_type.hpp> // for half

#include <complex>
#include <cstddef>
#include <cstdint>
#include <complex> // for complex
#include <cstddef> // for size_t
#include <cstdint> // for uint32_t

// TODO: include the header file with SPIR-V declarations from SPIRV-Headers
// project.
Expand Down
8 changes: 5 additions & 3 deletions sycl/include/CL/__spirv/spirv_vars.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

#pragma once

#include <cstddef>
#include <cstdint>

#ifdef __SYCL_DEVICE_ONLY__

#include <sycl/detail/defines_elementary.hpp> // for __DPCPP_SYCL_EXTERNAL

#include <cstddef> // for size_t
#include <cstdint> // for uint8_t

#define __SPIRV_VAR_QUALIFIERS extern "C" const

#if defined(__NVPTX__) || defined(__AMDGCN__)
Expand Down
8 changes: 6 additions & 2 deletions sycl/include/sycl/access/access.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#pragma once

#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEPRECATED

#ifdef __SYCL_DEVICE_ONLY__
#include <CL/__spirv/spirv_ops.hpp>
#include <sycl/detail/common.hpp>
#include <sycl/detail/defines.hpp>
#include <type_traits>
#endif

namespace sycl {
inline namespace _V1 {
Expand Down
78 changes: 49 additions & 29 deletions sycl/include/sycl/accessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,56 @@

#pragma once

#include <CL/__spirv/spirv_types.hpp>
#include <sycl/atomic.hpp>
#include <sycl/buffer.hpp>
#include <sycl/detail/accessor_iterator.hpp>
#include <sycl/detail/cl.h>
#include <sycl/detail/common.hpp>
#include <sycl/detail/export.hpp>
#include <sycl/detail/generic_type_traits.hpp>
#include <sycl/detail/handler_proxy.hpp>
#include <sycl/detail/image_accessor_util.hpp>
#include <sycl/access/access.hpp> // for target, mode
#include <sycl/aliases.hpp> // for float4, int4
#include <sycl/aspects.hpp> // for aspect
#include <sycl/atomic.hpp> // for atomic
#include <sycl/buffer.hpp> // for range
#include <sycl/detail/accessor_iterator.hpp> // for accessor_iterator
#include <sycl/detail/common.hpp> // for code_location
#include <sycl/detail/defines.hpp> // for __SYCL_SPECIAL...
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEP...
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
#include <sycl/detail/generic_type_traits.hpp> // for is_genint, Try...
#include <sycl/detail/handler_proxy.hpp> // for associateWithH...
#include <sycl/detail/helpers.hpp> // for loop
#include <sycl/detail/image_accessor_util.hpp> // for imageReadSampl...
#include <sycl/detail/owner_less_base.hpp> // for OwnerLessBase
#include <sycl/detail/pi.h> // for PI_ERROR_INVAL...
#include <sycl/detail/property_helper.hpp> // for PropWithDataKind
#include <sycl/detail/property_list_base.hpp> // for PropertyListBase
#include <sycl/detail/type_list.hpp> // for is_contained
#include <sycl/detail/type_traits.hpp> // for const_if_const_AS
#include <sycl/device.hpp> // for device
#include <sycl/exception.hpp> // for make_error_code
#include <sycl/ext/oneapi/accessor_property_list.hpp> // for accessor_prope...
#include <sycl/ext/oneapi/weak_object_base.hpp> // for getSyclWeakObj...
#include <sycl/id.hpp> // for id
#include <sycl/image.hpp> // for image, image_c...
#include <sycl/multi_ptr.hpp> // for multi_ptr
#include <sycl/pointers.hpp> // for local_ptr, glo...
#include <sycl/properties/accessor_properties.hpp> // for buffer_location
#include <sycl/properties/buffer_properties.hpp> // for buffer, buffer...
#include <sycl/property_list.hpp> // for property_list
#include <sycl/range.hpp> // for range
#include <sycl/sampler.hpp> // for addressing_mode
#include <sycl/types.hpp> // for vec

#ifdef __SYCL_DEVICE_ONLY__
#include <sycl/detail/image_ocl_types.hpp>
#include <sycl/detail/owner_less_base.hpp>
#include <sycl/device.hpp>
#include <sycl/exception.hpp>
#include <sycl/ext/oneapi/accessor_property_list.hpp>
#include <sycl/ext/oneapi/weak_object_base.hpp>
#include <sycl/id.hpp>
#include <sycl/image.hpp>
#include <sycl/pointers.hpp>
#include <sycl/properties/accessor_properties.hpp>
#include <sycl/properties/buffer_properties.hpp>
#include <sycl/property_list.hpp>
#include <sycl/property_list_conversion.hpp>
#include <sycl/sampler.hpp>

#include <iterator>
#include <optional>
#include <type_traits>

#include <utility>
#endif

#include <cstddef> // for size_t
#include <functional> // for hash
#include <iterator> // for reverse_iterator
#include <limits> // for numeric_limits
#include <memory> // for shared_ptr
#include <optional> // for nullopt, optional
#include <stdint.h> // for uint32_t
#include <tuple> // for _Swallow_assign
#include <type_traits> // for enable_if_t
#include <typeinfo> // for type_info
#include <variant> // for hash

/// \file accessor.hpp
/// The file contains implementations of accessor class.
Expand Down
8 changes: 3 additions & 5 deletions sycl/include/sycl/aliases.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@

#pragma once

#include <sycl/detail/cl.h>
#include <sycl/detail/common.hpp>
#include <sycl/detail/defines_elementary.hpp>
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEPRECATED
#include <sycl/half_type.hpp> // for half

#include <cstddef>
#include <cstdint>
#include <cstdint> // for uint8_t, int16_t, int32_t

namespace sycl {
inline namespace _V1 {
Expand Down
3 changes: 2 additions & 1 deletion sycl/include/sycl/aspects.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
// ===--------------------------------------------------------------------=== //
#pragma once

#include <sycl/detail/defines.hpp>
#include <sycl/detail/defines.hpp> // for __SYCL_TYPE
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEPRECATED

namespace sycl {
inline namespace _V1 {
Expand Down
4 changes: 1 addition & 3 deletions sycl/include/sycl/async_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

#pragma once

#include <sycl/detail/defines_elementary.hpp>

#include <functional>
#include <functional> // for function

namespace sycl {
inline namespace _V1 {
Expand Down
20 changes: 11 additions & 9 deletions sycl/include/sycl/atomic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@

#pragma once

#include <CL/__spirv/spirv_ops.hpp>
#include <sycl/access/access.hpp>
#include <sycl/detail/cl.h>
#include <sycl/detail/helpers.hpp>
#include <sycl/memory_enums.hpp>
#include <CL/__spirv/spirv_types.hpp> // for Scope, MemorySemanticsMask
#include <sycl/access/access.hpp> // for address_space, decorated
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEPRECATED
#include <sycl/detail/helpers.hpp> // for getSPIRVMemorySemanticsMask
#include <sycl/memory_enums.hpp> // for memory_order, getStdMemoryO...
#include <sycl/multi_ptr.hpp> // for multi_ptr

#ifndef __SYCL_DEVICE_ONLY__
#include <atomic>
#else
#include <type_traits> // for is_same

#ifdef __SYCL_DEVICE_ONLY__
#include <cstring>
#else
#include <atomic> // for atomic, memory_order
#endif
#include <type_traits>

#define __SYCL_STATIC_ASSERT_NOT_FLOAT(T) \
static_assert(!std::is_same<T, float>::value, \
Expand Down
10 changes: 5 additions & 5 deletions sycl/include/sycl/atomic_fence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

#pragma once

#include <CL/__spirv/spirv_ops.hpp>
#include <sycl/detail/spirv.hpp>
#include <sycl/memory_enums.hpp>
#include <sycl/memory_enums.hpp> // for getStdMemoryOrder, memory_order

#ifndef __SYCL_DEVICE_ONLY__
#include <atomic>
#ifdef __SYCL_DEVICE_ONLY__
#include <sycl/detail/spirv.hpp>
#else
#include <atomic> // for atomic_thread_fence
#endif

namespace sycl {
Expand Down
18 changes: 9 additions & 9 deletions sycl/include/sycl/atomic_ref.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@

#pragma once

#include <sycl/access/access.hpp>
#include <sycl/aspects.hpp>
#include <sycl/atomic.hpp>
#include <sycl/detail/defines.hpp>
#include <sycl/memory_enums.hpp>
#include <sycl/access/access.hpp> // for address_space
#include <sycl/bit_cast.hpp> // for bit_cast
#include <sycl/memory_enums.hpp> // for getStdMemoryOrder, memory_order

#ifdef __SYCL_DEVICE_ONLY__
#include <sycl/detail/spirv.hpp>
#include <sycl/multi_ptr.hpp>
#else
#include <atomic> // for atomic
#endif

#ifndef __SYCL_DEVICE_ONLY__
#include <atomic>
#endif
#include <type_traits>
#include <stddef.h> // for size_t, ptrdiff_t
#include <stdint.h> // for uintptr_t, uint32_t, uint64_t
#include <type_traits> // for enable_if_t, bool_constant

namespace sycl {
inline namespace _V1 {
Expand Down
53 changes: 32 additions & 21 deletions sycl/include/sycl/backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,33 @@

#pragma once

#include <sycl/accessor.hpp>
#include <sycl/backend_types.hpp>
#include <sycl/buffer.hpp>
#include <sycl/context.hpp>
#include <sycl/detail/backend_traits.hpp>
#include <sycl/feature_test.hpp>
#include <sycl/image.hpp>
#include <sycl/access/access.hpp> // for mode, placeholder
#include <sycl/accessor.hpp> // for accessor
#include <sycl/async_handler.hpp> // for async_handler
#include <sycl/backend_types.hpp> // for backend
#include <sycl/buffer.hpp> // for buffer_allocator
#include <sycl/context.hpp> // for context, get_na...
#include <sycl/detail/backend_traits.hpp> // for InteropFeatureS...
#include <sycl/detail/cl.h> // for _cl_event
#include <sycl/detail/defines_elementary.hpp> // for __SYCL_DEPRECATED
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
#include <sycl/detail/impl_utils.hpp> // for createSyclObjFr...
#include <sycl/detail/pi.h> // for pi_native_handle
#include <sycl/device.hpp> // for device, get_native
#include <sycl/event.hpp> // for event, get_native
#include <sycl/exception.hpp> // for make_error_code
#include <sycl/feature_test.hpp> // for SYCL_BACKEND_OP...
#include <sycl/handler.hpp> // for buffer
#include <sycl/image.hpp> // for image, image_al...
#include <sycl/kernel.hpp> // for kernel, get_native
#include <sycl/kernel_bundle.hpp> // for kernel_bundle
#include <sycl/kernel_bundle_enums.hpp> // for bundle_state
#include <sycl/platform.hpp> // for platform, get_n...
#include <sycl/property_list.hpp> // for property_list
#include <sycl/queue.hpp> // for queue, get_native

#if SYCL_BACKEND_OPENCL
#include <sycl/detail/backend_traits_opencl.hpp>
#include <sycl/detail/backend_traits_opencl.hpp> // for interop
#endif
#if SYCL_EXT_ONEAPI_BACKEND_CUDA
#ifdef SYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL
Expand All @@ -29,20 +47,13 @@
#include <sycl/detail/backend_traits_hip.hpp>
#endif
#if SYCL_EXT_ONEAPI_BACKEND_LEVEL_ZERO
#include <sycl/detail/backend_traits_level_zero.hpp>
#include <sycl/detail/backend_traits_level_zero.hpp> // for _ze_command_lis...
#endif
#include <sycl/detail/common.hpp>
#include <sycl/detail/export.hpp>
#include <sycl/detail/pi.h>
#include <sycl/detail/pi.hpp>
#include <sycl/device.hpp>
#include <sycl/event.hpp>
#include <sycl/exception.hpp>
#include <sycl/kernel_bundle.hpp>
#include <sycl/platform.hpp>
#include <sycl/queue.hpp>

#include <type_traits>

#include <memory> // for shared_ptr
#include <stdint.h> // for int32_t
#include <type_traits> // for enable_if_t
#include <vector> // for vector

namespace sycl {
inline namespace _V1 {
Expand Down
14 changes: 11 additions & 3 deletions sycl/include/sycl/backend/opencl.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

//==---------------- opencl.hpp - SYCL OpenCL backend ----------------------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
Expand All @@ -9,9 +8,18 @@

#pragma once

#include <sycl/backend.hpp>
#include <sycl/backend_types.hpp> // for backend
#include <sycl/context.hpp> // for context
#include <sycl/detail/backend_traits.hpp> // for interop
#include <sycl/detail/defines_elementary.hpp> // for __SYCL_DEPRECATED
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
#include <sycl/detail/pi.h> // for pi_native_handle
#include <sycl/device.hpp> // for device
#include <sycl/platform.hpp> // for platform
#include <sycl/queue.hpp> // for queue

#include <string>
#include <string> // for string
#include <type_traits> // for enable_if_t

namespace sycl {
inline namespace _V1 {
Expand Down
4 changes: 2 additions & 2 deletions sycl/include/sycl/backend_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

#pragma once

#include <sycl/detail/defines_elementary.hpp>
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEPRECATED

#include <ostream>
#include <ostream> // for operator<<, ostream

namespace sycl {
inline namespace _V1 {
Expand Down
Loading