From 630395919b99ac763928dad539ff064499ac1b17 Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Fri, 8 Nov 2024 10:22:34 +0100 Subject: [PATCH 1/9] [SYCL][NFC] Refactor `#include`s This patch is a collection of various cleanups made in public headers: - Cleaned up many unnecessary includes. It doesn't change total amount of header files we use in total by `sycl.hpp`, but makes our code cleaner - Made it so there are no headers depending on `backend.hpp` and it is only included by `sycl.hpp`, so that we can make it an opt-in header - Removed `types.hpp` in favor of direct use of `vector.hpp` - Added missing includes and forward-declarations to places where we relied on implicit includes - Moved certain helper function declarations/definitions to better places (common utils to utils headers, library-only declarations to library headers, etc.) --- sycl/include/sycl/aliases.hpp | 1 - sycl/include/sycl/backend.hpp | 26 +------------ sycl/include/sycl/backend_types.hpp | 10 ++++- sycl/include/sycl/builtins_esimd.hpp | 2 +- sycl/include/sycl/builtins_utils_vec.hpp | 2 +- sycl/include/sycl/detail/backend_traits.hpp | 3 +- sycl/include/sycl/detail/device_filter.hpp | 2 +- .../sycl/detail/image_accessor_util.hpp | 2 +- sycl/include/sycl/detail/ur.hpp | 2 +- sycl/include/sycl/detail/util.hpp | 37 +++++++++++++++++++ sycl/include/sycl/detail/vector_convert.hpp | 2 - sycl/include/sycl/device.hpp | 8 ++-- .../ext/intel/esimd/detail/memory_intrin.hpp | 2 +- .../sycl/ext/intel/fpga_device_selector.hpp | 1 + sycl/include/sycl/ext/oneapi/backend/hip.hpp | 2 +- .../sycl/ext/oneapi/backend/level_zero.hpp | 1 - sycl/include/sycl/ext/oneapi/dot_product.hpp | 2 +- .../ext/oneapi/experimental/backend/cuda.hpp | 2 +- .../sycl/ext/oneapi/experimental/builtins.hpp | 2 +- .../ext/oneapi/experimental/cuda/builtins.hpp | 2 +- .../experimental/non_uniform_groups.hpp | 2 +- .../sycl/ext/oneapi/experimental/prefetch.hpp | 2 +- .../sycl/ext/oneapi/sub_group_mask.hpp | 2 +- sycl/include/sycl/group_algorithm.hpp | 2 +- sycl/include/sycl/image.hpp | 2 +- sycl/include/sycl/interop_handle.hpp | 6 +-- sycl/include/sycl/kernel.hpp | 12 +++--- sycl/include/sycl/known_identity.hpp | 2 +- sycl/include/sycl/platform.hpp | 37 ------------------- sycl/include/sycl/stream.hpp | 2 +- sycl/include/sycl/sycl.hpp | 5 ++- sycl/include/sycl/types.hpp | 28 -------------- sycl/include/sycl/vector.hpp | 6 ++- sycl/source/backend/level_zero.cpp | 2 +- sycl/source/backend/opencl.cpp | 1 - sycl/source/detail/adapter.hpp | 2 +- sycl/source/detail/allowlist.cpp | 2 +- .../composite_device/composite_device.cpp | 1 + sycl/source/detail/config.cpp | 1 + sycl/source/detail/config.hpp | 2 +- sycl/source/detail/kernel_impl.hpp | 1 + sycl/source/detail/platform_impl.cpp | 2 +- sycl/source/detail/platform_impl.hpp | 1 - sycl/source/detail/sampler_impl.cpp | 1 + sycl/source/detail/ur.hpp | 6 ++- sycl/source/detail/windows_ur.cpp | 1 - sycl/test/include_deps/sycl_accessor.hpp.cpp | 13 ++++--- sycl/test/include_deps/sycl_buffer.hpp.cpp | 1 + .../include_deps/sycl_detail_core.hpp.cpp | 13 ++++--- 49 files changed, 116 insertions(+), 153 deletions(-) delete mode 100644 sycl/include/sycl/types.hpp diff --git a/sycl/include/sycl/aliases.hpp b/sycl/include/sycl/aliases.hpp index 1640c11db6078..fc359b7659802 100644 --- a/sycl/include/sycl/aliases.hpp +++ b/sycl/include/sycl/aliases.hpp @@ -9,7 +9,6 @@ #pragma once #include // for __SYCL2020_DEPRECATED -#include // for half #include // for uint8_t, int16_t, int32_t diff --git a/sycl/include/sycl/backend.hpp b/sycl/include/sycl/backend.hpp index 24750732b08ff..2b2380612c926 100644 --- a/sycl/include/sycl/backend.hpp +++ b/sycl/include/sycl/backend.hpp @@ -15,7 +15,6 @@ #include // for buffer_allocator #include // for context, get_na... #include // for InteropFeatureS... -#include // for _cl_event #include // for __SYCL_DEPRECATED #include // for __SYCL_EXPORT #include // for createSyclObjFr... @@ -23,13 +22,10 @@ #include // for event, get_native #include // for make_error_code #include // for SYCL_BACKEND_OP... -#include // for buffer #include // for image, image_al... -#include // for kernel, get_native #include // for kernel_bundle #include // for bundle_state #include // for platform, get_n... -#include // for property_list #include // for queue, get_native #include // for ur_native_handle_t @@ -60,32 +56,14 @@ namespace sycl { inline namespace _V1 { +class property_list; + namespace detail { // TODO each backend can have its own custom errc enumeration // but the details for this are not fully specified yet enum class backend_errc : unsigned int {}; - -// Convert from UR backend to SYCL backend enum -backend convertUrBackend(ur_platform_backend_t UrBackend); } // namespace detail -template class backend_traits { -public: - template - using input_type = typename detail::BackendInput::type; - - template - using return_type = typename detail::BackendReturn::type; -}; - -template -using backend_input_t = - typename backend_traits::template input_type; - -template -using backend_return_t = - typename backend_traits::template return_type; - namespace detail { template struct BufferInterop { diff --git a/sycl/include/sycl/backend_types.hpp b/sycl/include/sycl/backend_types.hpp index c0a274febc9e7..51802cfebade6 100644 --- a/sycl/include/sycl/backend_types.hpp +++ b/sycl/include/sycl/backend_types.hpp @@ -8,6 +8,7 @@ #pragma once +#include #include // for __SYCL2020_DEPRECATED #include // for operator<<, ostream @@ -27,7 +28,14 @@ enum class backend : char { ext_oneapi_native_cpu = 7, }; -template class backend_traits; +template class backend_traits { +public: + template + using input_type = typename detail::BackendInput::type; + + template + using return_type = typename detail::BackendReturn::type; +}; template using backend_input_t = diff --git a/sycl/include/sycl/builtins_esimd.hpp b/sycl/include/sycl/builtins_esimd.hpp index fa720a405f9be..49566ce118eba 100644 --- a/sycl/include/sycl/builtins_esimd.hpp +++ b/sycl/include/sycl/builtins_esimd.hpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include // TODO Decide whether to mark functions with this attribute. #define __NOEXC /*noexcept*/ diff --git a/sycl/include/sycl/builtins_utils_vec.hpp b/sycl/include/sycl/builtins_utils_vec.hpp index 178c696495c8e..caaaf0242c637 100644 --- a/sycl/include/sycl/builtins_utils_vec.hpp +++ b/sycl/include/sycl/builtins_utils_vec.hpp @@ -14,7 +14,7 @@ #include #include // for marray -#include // for vec +#include // for vec namespace sycl { inline namespace _V1 { diff --git a/sycl/include/sycl/detail/backend_traits.hpp b/sycl/include/sycl/detail/backend_traits.hpp index adbbab78642ff..87c00ce6d63d3 100644 --- a/sycl/include/sycl/detail/backend_traits.hpp +++ b/sycl/include/sycl/detail/backend_traits.hpp @@ -8,10 +8,9 @@ #pragma once -#include - namespace sycl { inline namespace _V1 { +enum class backend : char; namespace detail { template struct interop; diff --git a/sycl/include/sycl/detail/device_filter.hpp b/sycl/include/sycl/detail/device_filter.hpp index 5574bf69a3484..9ca26333ab15a 100644 --- a/sycl/include/sycl/detail/device_filter.hpp +++ b/sycl/include/sycl/detail/device_filter.hpp @@ -8,7 +8,6 @@ #pragma once -#include #include #include @@ -18,6 +17,7 @@ namespace sycl { inline namespace _V1 { +enum class backend : char; namespace detail { // --------------------------------------- diff --git a/sycl/include/sycl/detail/image_accessor_util.hpp b/sycl/include/sycl/detail/image_accessor_util.hpp index 49dacd704a748..27fffcafe94a3 100644 --- a/sycl/include/sycl/detail/image_accessor_util.hpp +++ b/sycl/include/sycl/detail/image_accessor_util.hpp @@ -24,7 +24,7 @@ #include // for image_channel_type #include // for range #include // for addressing_mode, coor... -#include // for vec, operator*, round... +#include // for vec, operator*, round... #include // for int32_t, uint16_t #include // for size_t diff --git a/sycl/include/sycl/detail/ur.hpp b/sycl/include/sycl/detail/ur.hpp index 70b6517b43748..1ed65046c0c1b 100644 --- a/sycl/include/sycl/detail/ur.hpp +++ b/sycl/include/sycl/detail/ur.hpp @@ -14,7 +14,6 @@ #pragma once -#include #include #include #include @@ -42,6 +41,7 @@ struct trace_event_data_t; namespace sycl { inline namespace _V1 { +enum class backend : char; class context; namespace detail { diff --git a/sycl/include/sycl/detail/util.hpp b/sycl/include/sycl/detail/util.hpp index d858aba279f41..56d4b12df2bc9 100644 --- a/sycl/include/sycl/detail/util.hpp +++ b/sycl/include/sycl/detail/util.hpp @@ -15,6 +15,9 @@ #include #include +#include +#include +#include #include namespace sycl { @@ -83,6 +86,40 @@ template <> struct ABINeutralT> { }; template using ABINeutralT_t = typename ABINeutralT::type; + +template auto convert_to_abi_neutral(ParamT &&Info) { + using ParamNoRef = std::remove_reference_t; + if constexpr (std::is_same_v) { + return detail::string{Info}; + } else if constexpr (std::is_same_v>) { + std::vector Res; + Res.reserve(Info.size()); + for (std::string &Str : Info) { + Res.push_back(detail::string{Str}); + } + return Res; + } else { + return std::forward(Info); + } +} + +template auto convert_from_abi_neutral(ParamT &&Info) { + using ParamNoRef = std::remove_reference_t; + if constexpr (std::is_same_v) { + return Info.c_str(); + } else if constexpr (std::is_same_v>) { + std::vector Res; + Res.reserve(Info.size()); + for (detail::string &Str : Info) { + Res.push_back(Str.c_str()); + } + return Res; + } else { + return std::forward(Info); + } +} + } // namespace detail } // namespace _V1 } // namespace sycl diff --git a/sycl/include/sycl/detail/vector_convert.hpp b/sycl/include/sycl/detail/vector_convert.hpp index c4bd584be80da..d8262f9d1aaec 100644 --- a/sycl/include/sycl/detail/vector_convert.hpp +++ b/sycl/include/sycl/detail/vector_convert.hpp @@ -58,7 +58,6 @@ #include // for errc #include // bfloat16 -#include #ifndef __SYCL_DEVICE_ONLY__ #include // for fesetround, fegetround @@ -153,7 +152,6 @@ __imf_ushort_as_bfloat16(unsigned short x); #endif // __SYCL_DEVICE_ONLY__ && (defined(__SPIR__) || defined(__SPIRV__)) namespace sycl { - inline namespace _V1 { #ifndef __SYCL_DEVICE_ONLY__ // TODO: Refactor includes so we can just "#include". diff --git a/sycl/include/sycl/device.hpp b/sycl/include/sycl/device.hpp index d49a1f1d1ff9a..57b193b4987b3 100644 --- a/sycl/include/sycl/device.hpp +++ b/sycl/include/sycl/device.hpp @@ -8,7 +8,6 @@ #pragma once -#include #include #include #include @@ -21,9 +20,12 @@ #include #include #include -#include #include +#ifdef __SYCL_INTERNAL_API +#include +#endif + #include #include #include @@ -35,7 +37,7 @@ namespace sycl { inline namespace _V1 { // Forward declarations -class device_selector; +class platform; template auto get_native(const SyclObjectT &Obj) -> backend_return_t; diff --git a/sycl/include/sycl/ext/intel/esimd/detail/memory_intrin.hpp b/sycl/include/sycl/ext/intel/esimd/detail/memory_intrin.hpp index 89636fda85019..2240379d5eed7 100644 --- a/sycl/include/sycl/ext/intel/esimd/detail/memory_intrin.hpp +++ b/sycl/include/sycl/ext/intel/esimd/detail/memory_intrin.hpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include diff --git a/sycl/include/sycl/ext/intel/fpga_device_selector.hpp b/sycl/include/sycl/ext/intel/fpga_device_selector.hpp index f3d6b1bb00d70..91ec593fe6f6a 100644 --- a/sycl/include/sycl/ext/intel/fpga_device_selector.hpp +++ b/sycl/include/sycl/ext/intel/fpga_device_selector.hpp @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/sycl/include/sycl/ext/oneapi/backend/hip.hpp b/sycl/include/sycl/ext/oneapi/backend/hip.hpp index 0f59dd2f4116a..86f22d74e78d9 100644 --- a/sycl/include/sycl/ext/oneapi/backend/hip.hpp +++ b/sycl/include/sycl/ext/oneapi/backend/hip.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include #include namespace sycl { diff --git a/sycl/include/sycl/ext/oneapi/backend/level_zero.hpp b/sycl/include/sycl/ext/oneapi/backend/level_zero.hpp index 7ff2845f6bde4..dec7d78ea1011 100644 --- a/sycl/include/sycl/ext/oneapi/backend/level_zero.hpp +++ b/sycl/include/sycl/ext/oneapi/backend/level_zero.hpp @@ -9,7 +9,6 @@ #pragma once #include // for async_han... -#include // for backend_i... #include // for backend #include // for buffer_al... #include // for buffer diff --git a/sycl/include/sycl/ext/oneapi/dot_product.hpp b/sycl/include/sycl/ext/oneapi/dot_product.hpp index 4fda07052e25a..cec308ba26b55 100644 --- a/sycl/include/sycl/ext/oneapi/dot_product.hpp +++ b/sycl/include/sycl/ext/oneapi/dot_product.hpp @@ -11,7 +11,7 @@ #pragma once #include -#include +#include namespace sycl { inline namespace _V1 { diff --git a/sycl/include/sycl/ext/oneapi/experimental/backend/cuda.hpp b/sycl/include/sycl/ext/oneapi/experimental/backend/cuda.hpp index 4412c5c1a0c23..7d5a18b85e5b6 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/backend/cuda.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/backend/cuda.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include diff --git a/sycl/include/sycl/ext/oneapi/experimental/builtins.hpp b/sycl/include/sycl/ext/oneapi/experimental/builtins.hpp index facc486ca2f84..7fab446f42d40 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/builtins.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/builtins.hpp @@ -15,7 +15,7 @@ #include // for is_svgenfloath, is_sv... #include // detail::memcpy #include // for marray -#include // for vec +#include // for vec #include // for size_t #include // for printf diff --git a/sycl/include/sycl/ext/oneapi/experimental/cuda/builtins.hpp b/sycl/include/sycl/ext/oneapi/experimental/cuda/builtins.hpp index 067e238c2e36c..3609c282a5319 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/cuda/builtins.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/cuda/builtins.hpp @@ -10,7 +10,7 @@ #define SYCL_EXT_ONEAPI_CUDA_TEX_CACHE_READ 1 -#include +#include #if defined(_WIN32) || defined(_WIN64) #define ATTRIBUTE_EXT_VEC_TYPE(N) __declspec(ext_vector_type(N)) diff --git a/sycl/include/sycl/ext/oneapi/experimental/non_uniform_groups.hpp b/sycl/include/sycl/ext/oneapi/experimental/non_uniform_groups.hpp index af68ce0e10e0f..d201a3374cbe0 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/non_uniform_groups.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/non_uniform_groups.hpp @@ -10,7 +10,7 @@ #include // for sub_group_mask #include // for marray -#include // for vec +#include // for vec #include // for size_t #include // for uint32_t diff --git a/sycl/include/sycl/ext/oneapi/experimental/prefetch.hpp b/sycl/include/sycl/ext/oneapi/experimental/prefetch.hpp index 441e32a085990..29c25d6a0860b 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/prefetch.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/prefetch.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include namespace sycl { inline namespace _V1 { diff --git a/sycl/include/sycl/ext/oneapi/sub_group_mask.hpp b/sycl/include/sycl/ext/oneapi/sub_group_mask.hpp index 7a3bef52110db..3dd21f8b070ea 100644 --- a/sycl/include/sycl/ext/oneapi/sub_group_mask.hpp +++ b/sycl/include/sycl/ext/oneapi/sub_group_mask.hpp @@ -14,7 +14,7 @@ #include // for SYCL_EXT_ONEAPI_SUB_GROUP_MASK #include // for id #include // for marray -#include // for vec +#include // for vec #include // for assert #include // for CHAR_BIT diff --git a/sycl/include/sycl/group_algorithm.hpp b/sycl/include/sycl/group_algorithm.hpp index 14eb2ea011587..ac2950be0bb3f 100644 --- a/sycl/include/sycl/group_algorithm.hpp +++ b/sycl/include/sycl/group_algorithm.hpp @@ -22,7 +22,7 @@ #include // for nd_item #include // for range #include // for sub_group -#include // for vec +#include // for vec #ifdef __SYCL_DEVICE_ONLY__ #include diff --git a/sycl/include/sycl/image.hpp b/sycl/include/sycl/image.hpp index 386fe93d3e41d..a257239ace932 100644 --- a/sycl/include/sycl/image.hpp +++ b/sycl/include/sycl/image.hpp @@ -29,7 +29,7 @@ #include // for property_list #include // for range, rangeTo... #include // for image_sampler -#include // for vec +#include // for vec #include // for ur_native_hand... #include // for size_t, nullptr_t diff --git a/sycl/include/sycl/interop_handle.hpp b/sycl/include/sycl/interop_handle.hpp index 81e4a9d559caa..0c21564b75e6b 100644 --- a/sycl/include/sycl/interop_handle.hpp +++ b/sycl/include/sycl/interop_handle.hpp @@ -11,16 +11,12 @@ #include // for target, mode, place... #include // for AccessorBaseHost #include // for backend, backend_re... -#include // for context #include // for __SYCL_EXPORT -#include // for context_impl #include // for getSyclObjImpl -#include // for device, device_impl #include -#include // for queue_impl #include // for accessor_property_list #include // for image -#include // for buffer +#include // for buffer #include // for ur_mem_handle_t, ur... #include // for shared_ptr diff --git a/sycl/include/sycl/kernel.hpp b/sycl/include/sycl/kernel.hpp index dac7f619d745e..455d2a1b1703f 100644 --- a/sycl/include/sycl/kernel.hpp +++ b/sycl/include/sycl/kernel.hpp @@ -8,28 +8,26 @@ #pragma once -#include // for size_t -#include // for shared_ptr, hash, opera... #include // for backend, backend_return_t -#include // for context #include // for __SYCL2020_DEPRECATED #include // for __SYCL_EXPORT #include // for is_kernel_device_specif... #include // for OwnerLessBase -#include -#include #include -#include // for device #include // for bundle_state -#include // for range #include // for ur_native_handle_t + #include // for hash +#include // for size_t +#include // for shared_ptr, hash, opera... namespace sycl { inline namespace _V1 { // Forward declaration class context; class queue; +class device; +template class range; template class backend_traits; template class kernel_bundle; template diff --git a/sycl/include/sycl/known_identity.hpp b/sycl/include/sycl/known_identity.hpp index 3aecad3188e49..89b1bae190c0f 100644 --- a/sycl/include/sycl/known_identity.hpp +++ b/sycl/include/sycl/known_identity.hpp @@ -13,7 +13,7 @@ #include // for bit_and, bit_or, bit_xor #include // for half #include // for marray -#include // for vec +#include // for vec #include // for byte, size_t #include // for logical_and, logical_or diff --git a/sycl/include/sycl/platform.hpp b/sycl/include/sycl/platform.hpp index 0d10080e00142..7fa167a062a0a 100644 --- a/sycl/include/sycl/platform.hpp +++ b/sycl/include/sycl/platform.hpp @@ -8,9 +8,7 @@ #pragma once -#include #include -#include #include #include #include @@ -40,9 +38,6 @@ inline namespace _V1 { class device; class context; -template -auto get_native(const SyclObjectT &Obj) - -> backend_return_t; namespace detail { class platform_impl; @@ -55,38 +50,6 @@ class platform_impl; /// \param Val Indicates if extension should be enabled/disabled void __SYCL_EXPORT enable_ext_oneapi_default_context(bool Val); -template auto convert_to_abi_neutral(ParamT &&Info) { - using ParamNoRef = std::remove_reference_t; - if constexpr (std::is_same_v) { - return detail::string{Info}; - } else if constexpr (std::is_same_v>) { - std::vector Res; - Res.reserve(Info.size()); - for (std::string &Str : Info) { - Res.push_back(detail::string{Str}); - } - return Res; - } else { - return std::forward(Info); - } -} - -template auto convert_from_abi_neutral(ParamT &&Info) { - using ParamNoRef = std::remove_reference_t; - if constexpr (std::is_same_v) { - return Info.c_str(); - } else if constexpr (std::is_same_v>) { - std::vector Res; - Res.reserve(Info.size()); - for (detail::string &Str : Info) { - Res.push_back(Str.c_str()); - } - return Res; - } else { - return std::forward(Info); - } -} } // namespace detail namespace ext::oneapi { // Forward declaration diff --git a/sycl/include/sycl/stream.hpp b/sycl/include/sycl/stream.hpp index 2b18a8ef4b423..5d1d06ab9eaa6 100644 --- a/sycl/include/sycl/stream.hpp +++ b/sycl/include/sycl/stream.hpp @@ -29,7 +29,7 @@ #include // for property_list #include // for range #include // for multi_ptr -#include // for vec, SwizzleOp +#include // for vec, SwizzleOp #include // for size_t, byte #include // for hash, shared_ptr diff --git a/sycl/include/sycl/sycl.hpp b/sycl/include/sycl/sycl.hpp index 846c4fb175c38..755cfd94c0227 100644 --- a/sycl/include/sycl/sycl.hpp +++ b/sycl/include/sycl/sycl.hpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -54,7 +53,7 @@ #include #include #include -#include +#include #include #include #include @@ -62,6 +61,7 @@ #if SYCL_EXT_ONEAPI_BACKEND_LEVEL_ZERO #include #endif +#include #include #include #include @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include diff --git a/sycl/include/sycl/types.hpp b/sycl/include/sycl/types.hpp deleted file mode 100644 index 599ba89819241..0000000000000 --- a/sycl/include/sycl/types.hpp +++ /dev/null @@ -1,28 +0,0 @@ -//==---------------- types.hpp --- SYCL types ------------------------------==// -// -// 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 - -#include // for decorated, address_space -#include // for half, cl_char, cl_int -#include // for ArrayCreator, RepeatV... -#include // for __SYCL2020_DEPRECATED -#include // for is_sigeninteger, is_s... -#include -#include // for is_contained -#include // for is_floating_point -#include // for make_error_code, errc -#include // for StorageT, half, Vec16... -#include // for __SYCL_BINOP, __SYCL_... -#include // for multi_ptr - -#include - -#include - -#include // bfloat16 diff --git a/sycl/include/sycl/vector.hpp b/sycl/include/sycl/vector.hpp index 01e70f639e7b5..9d07b84193564 100644 --- a/sycl/include/sycl/vector.hpp +++ b/sycl/include/sycl/vector.hpp @@ -51,7 +51,8 @@ namespace sycl { -// TODO: Fix in the next ABI breaking windows. +// TODO: It should be within _V1 namespace, fix in the next ABI breaking +// windows. enum class rounding_mode { automatic = 0, rte = 1, rtz = 2, rtp = 3, rtn = 4 }; inline namespace _V1 { @@ -359,6 +360,7 @@ class __SYCL_EBO vec public: // Out-of-class definition is in `sycl/detail/vector_convert.hpp` + // It is included at the _end_ of this file template vec convert() const; @@ -1315,3 +1317,5 @@ class SwizzleOp { } // namespace detail } // namespace _V1 } // namespace sycl + +#include diff --git a/sycl/source/backend/level_zero.cpp b/sycl/source/backend/level_zero.cpp index e6b42c366243c..75a67745f6849 100644 --- a/sycl/source/backend/level_zero.cpp +++ b/sycl/source/backend/level_zero.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include namespace sycl { inline namespace _V1 { diff --git a/sycl/source/backend/opencl.cpp b/sycl/source/backend/opencl.cpp index 56627a22dbb56..e0c669cb8c267 100644 --- a/sycl/source/backend/opencl.cpp +++ b/sycl/source/backend/opencl.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include diff --git a/sycl/source/detail/adapter.hpp b/sycl/source/detail/adapter.hpp index 700585a4d6a72..d78743ac6159e 100644 --- a/sycl/source/detail/adapter.hpp +++ b/sycl/source/detail/adapter.hpp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -35,6 +34,7 @@ namespace sycl { inline namespace _V1 { +enum class backend : char; namespace detail { /// The adapter class provides a unified interface to the underlying low-level diff --git a/sycl/source/detail/allowlist.cpp b/sycl/source/detail/allowlist.cpp index a6113130aabda..96b9577aca975 100644 --- a/sycl/source/detail/allowlist.cpp +++ b/sycl/source/detail/allowlist.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include diff --git a/sycl/source/detail/composite_device/composite_device.cpp b/sycl/source/detail/composite_device/composite_device.cpp index 6c57eb3015df1..71e43bd0a8e0f 100644 --- a/sycl/source/detail/composite_device/composite_device.cpp +++ b/sycl/source/detail/composite_device/composite_device.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// +#include #include #include diff --git a/sycl/source/detail/config.cpp b/sycl/source/detail/config.cpp index 21ce89458835f..ab25564c59370 100644 --- a/sycl/source/detail/config.cpp +++ b/sycl/source/detail/config.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include +#include #include #include #include diff --git a/sycl/source/detail/config.hpp b/sycl/source/detail/config.hpp index 49bef4fbb6cf1..3c1f2f6822807 100644 --- a/sycl/source/detail/config.hpp +++ b/sycl/source/detail/config.hpp @@ -9,7 +9,6 @@ #pragma once #include -#include #include #include #include @@ -25,6 +24,7 @@ namespace sycl { inline namespace _V1 { +enum class backend : char; namespace detail { #ifdef DISABLE_CONFIG_FROM_ENV diff --git a/sycl/source/detail/kernel_impl.hpp b/sycl/source/detail/kernel_impl.hpp index 1b71eb3e659ad..2dee6d9da151e 100644 --- a/sycl/source/detail/kernel_impl.hpp +++ b/sycl/source/detail/kernel_impl.hpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/sycl/source/detail/platform_impl.cpp b/sycl/source/detail/platform_impl.cpp index a6ddbc9156043..cb9a9f0f1b97f 100644 --- a/sycl/source/detail/platform_impl.cpp +++ b/sycl/source/detail/platform_impl.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sycl/source/detail/platform_impl.hpp b/sycl/source/detail/platform_impl.hpp index d50b3d1b5d8c9..982e619f4555a 100644 --- a/sycl/source/detail/platform_impl.hpp +++ b/sycl/source/detail/platform_impl.hpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/sycl/source/detail/sampler_impl.cpp b/sycl/source/detail/sampler_impl.cpp index 07582dee0dd31..81989a72c1146 100644 --- a/sycl/source/detail/sampler_impl.cpp +++ b/sycl/source/detail/sampler_impl.cpp @@ -9,6 +9,7 @@ #include #include #include +#include namespace sycl { inline namespace _V1 { diff --git a/sycl/source/detail/ur.hpp b/sycl/source/detail/ur.hpp index e0014866ebeb8..a599169ee3aec 100644 --- a/sycl/source/detail/ur.hpp +++ b/sycl/source/detail/ur.hpp @@ -14,7 +14,6 @@ #pragma once -#include #include #include @@ -22,6 +21,7 @@ namespace sycl { inline namespace _V1 { +enum class backend : char; namespace detail { class Adapter; using AdapterPtr = std::shared_ptr; @@ -36,6 +36,10 @@ initializeUr(ur_loader_config_handle_t LoaderConfig = nullptr); // Get the adapter serving given backend. template const AdapterPtr &getAdapter(); } // namespace ur + +// Convert from UR backend to SYCL backend enum +backend convertUrBackend(ur_platform_backend_t UrBackend); + } // namespace detail } // namespace _V1 } // namespace sycl diff --git a/sycl/source/detail/windows_ur.cpp b/sycl/source/detail/windows_ur.cpp index 6f8d1f7ae6bdf..bac1163d6d3bd 100644 --- a/sycl/source/detail/windows_ur.cpp +++ b/sycl/source/detail/windows_ur.cpp @@ -6,7 +6,6 @@ // //===----------------------------------------------------------------------===// -#include #include #include diff --git a/sycl/test/include_deps/sycl_accessor.hpp.cpp b/sycl/test/include_deps/sycl_accessor.hpp.cpp index 622ea90da7006..d54156de82c55 100644 --- a/sycl/test/include_deps/sycl_accessor.hpp.cpp +++ b/sycl/test/include_deps/sycl_accessor.hpp.cpp @@ -17,12 +17,6 @@ // CHECK-NEXT: __spirv/spirv_vars.hpp // CHECK-NEXT: multi_ptr.hpp // CHECK-NEXT: aliases.hpp -// CHECK-NEXT: half_type.hpp -// CHECK-NEXT: bit_cast.hpp -// CHECK-NEXT: detail/iostream_proxy.hpp -// CHECK-NEXT: aspects.hpp -// CHECK-NEXT: info/aspects.def -// CHECK-NEXT: info/aspects_deprecated.def // CHECK-NEXT: detail/type_traits.hpp // CHECK-NEXT: detail/type_traits/vec_marray_traits.hpp // CHECK-NEXT: detail/type_list.hpp @@ -55,8 +49,15 @@ // CHECK-NEXT: stl_wrappers/cassert // CHECK-NEXT: stl_wrappers/assert.h // CHECK-NEXT: detail/boost/mp11/integer_sequence.hpp +// CHECK-NEXT: half_type.hpp +// CHECK-NEXT: bit_cast.hpp +// CHECK-NEXT: detail/iostream_proxy.hpp +// CHECK-NEXT: aspects.hpp +// CHECK-NEXT: info/aspects.def +// CHECK-NEXT: info/aspects_deprecated.def // CHECK-NEXT: buffer.hpp // CHECK-NEXT: backend_types.hpp +// CHECK-NEXT: detail/backend_traits.hpp // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/string.hpp diff --git a/sycl/test/include_deps/sycl_buffer.hpp.cpp b/sycl/test/include_deps/sycl_buffer.hpp.cpp index 0c38ee6bde31c..bf43891c87a37 100644 --- a/sycl/test/include_deps/sycl_buffer.hpp.cpp +++ b/sycl/test/include_deps/sycl_buffer.hpp.cpp @@ -12,6 +12,7 @@ // CHECK-NEXT: detail/defines.hpp // CHECK-NEXT: detail/export.hpp // CHECK-NEXT: backend_types.hpp +// CHECK-NEXT: detail/backend_traits.hpp // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/string.hpp diff --git a/sycl/test/include_deps/sycl_detail_core.hpp.cpp b/sycl/test/include_deps/sycl_detail_core.hpp.cpp index e9555d3ad95d1..22061fd4a89f7 100644 --- a/sycl/test/include_deps/sycl_detail_core.hpp.cpp +++ b/sycl/test/include_deps/sycl_detail_core.hpp.cpp @@ -18,12 +18,6 @@ // CHECK-NEXT: __spirv/spirv_vars.hpp // CHECK-NEXT: multi_ptr.hpp // CHECK-NEXT: aliases.hpp -// CHECK-NEXT: half_type.hpp -// CHECK-NEXT: bit_cast.hpp -// CHECK-NEXT: detail/iostream_proxy.hpp -// CHECK-NEXT: aspects.hpp -// CHECK-NEXT: info/aspects.def -// CHECK-NEXT: info/aspects_deprecated.def // CHECK-NEXT: detail/type_traits.hpp // CHECK-NEXT: detail/type_traits/vec_marray_traits.hpp // CHECK-NEXT: detail/type_list.hpp @@ -56,8 +50,15 @@ // CHECK-NEXT: stl_wrappers/cassert // CHECK-NEXT: stl_wrappers/assert.h // CHECK-NEXT: detail/boost/mp11/integer_sequence.hpp +// CHECK-NEXT: half_type.hpp +// CHECK-NEXT: bit_cast.hpp +// CHECK-NEXT: detail/iostream_proxy.hpp +// CHECK-NEXT: aspects.hpp +// CHECK-NEXT: info/aspects.def +// CHECK-NEXT: info/aspects_deprecated.def // CHECK-NEXT: buffer.hpp // CHECK-NEXT: backend_types.hpp +// CHECK-NEXT: detail/backend_traits.hpp // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/string.hpp From 99feb53ff8a8641033c25f74be09238e6581b30b Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Fri, 8 Nov 2024 06:52:24 -0800 Subject: [PATCH 2/9] Some fixes & clang-format --- sycl/include/sycl/builtins_utils_vec.hpp | 2 +- sycl/include/sycl/detail/image_accessor_util.hpp | 2 +- sycl/include/sycl/ext/oneapi/experimental/builtins.hpp | 2 +- sycl/include/sycl/ext/oneapi/sub_group_mask.hpp | 2 +- sycl/include/sycl/group_algorithm.hpp | 2 +- sycl/include/sycl/image.hpp | 2 +- sycl/include/sycl/interop_handle.hpp | 2 +- sycl/include/sycl/kernel.hpp | 6 +++--- sycl/include/sycl/known_identity.hpp | 2 +- sycl/include/sycl/stream.hpp | 2 +- sycl/include/sycl/sycl.hpp | 4 ++-- sycl/source/detail/buffer_impl.hpp | 1 - sycl/test-e2e/Basic/buffer/buffer.cpp | 2 +- sycl/test-e2e/Basic/group_async_copy.cpp | 2 +- sycl/test-e2e/Basic/group_async_copy_legacy.cpp | 2 +- sycl/test-e2e/Basic/half_type.cpp | 2 +- sycl/test-e2e/Basic/parallel_for_indexers.cpp | 2 +- sycl/test-e2e/Basic/parallel_for_range_roundup.cpp | 2 +- sycl/test-e2e/Basic/swizzle_op.cpp | 2 +- sycl/test-e2e/Basic/vector/bool.cpp | 2 +- sycl/test-e2e/Basic/vector/byte.cpp | 2 +- sycl/test-e2e/Basic/vector/int-convert.cpp | 2 +- sycl/test-e2e/Basic/vector/load_store.cpp | 2 +- sycl/test-e2e/Basic/vector/operators.cpp | 2 +- sycl/test-e2e/Basic/vector/scalar_access.cpp | 2 +- sycl/test-e2e/Basic/vector/vec_binary_scalar_order.hpp | 2 +- sycl/test-e2e/Regression/get_spec_const_vec16.cpp | 2 +- sycl/test-e2e/Regression/group.cpp | 2 +- sycl/test-e2e/Regression/local-arg-align.cpp | 2 +- sycl/test-e2e/Regression/swizzle_opassign.cpp | 2 +- sycl/test-e2e/Regression/vec_rel_swizzle_ops.cpp | 2 +- sycl/test/abi/layout_vec.cpp | 2 +- sycl/test/abi/symbol_size_alignment.cpp | 2 +- sycl/test/basic_tests/interop-level-zero-2020.cpp | 1 + sycl/test/basic_tests/vectors/size_one_checks.cpp | 2 +- .../test/check_device_code/vector/vector_convert_bfloat.cpp | 2 +- 36 files changed, 38 insertions(+), 38 deletions(-) diff --git a/sycl/include/sycl/builtins_utils_vec.hpp b/sycl/include/sycl/builtins_utils_vec.hpp index caaaf0242c637..3c1d429a816db 100644 --- a/sycl/include/sycl/builtins_utils_vec.hpp +++ b/sycl/include/sycl/builtins_utils_vec.hpp @@ -13,7 +13,7 @@ #include #include -#include // for marray +#include // for marray #include // for vec namespace sycl { diff --git a/sycl/include/sycl/detail/image_accessor_util.hpp b/sycl/include/sycl/detail/image_accessor_util.hpp index 27fffcafe94a3..6e6fa7540cd95 100644 --- a/sycl/include/sycl/detail/image_accessor_util.hpp +++ b/sycl/include/sycl/detail/image_accessor_util.hpp @@ -24,7 +24,7 @@ #include // for image_channel_type #include // for range #include // for addressing_mode, coor... -#include // for vec, operator*, round... +#include // for vec, operator*, round... #include // for int32_t, uint16_t #include // for size_t diff --git a/sycl/include/sycl/ext/oneapi/experimental/builtins.hpp b/sycl/include/sycl/ext/oneapi/experimental/builtins.hpp index 7fab446f42d40..d42df1fee26c8 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/builtins.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/builtins.hpp @@ -15,7 +15,7 @@ #include // for is_svgenfloath, is_sv... #include // detail::memcpy #include // for marray -#include // for vec +#include // for vec #include // for size_t #include // for printf diff --git a/sycl/include/sycl/ext/oneapi/sub_group_mask.hpp b/sycl/include/sycl/ext/oneapi/sub_group_mask.hpp index 3dd21f8b070ea..a99e1f9970165 100644 --- a/sycl/include/sycl/ext/oneapi/sub_group_mask.hpp +++ b/sycl/include/sycl/ext/oneapi/sub_group_mask.hpp @@ -14,7 +14,7 @@ #include // for SYCL_EXT_ONEAPI_SUB_GROUP_MASK #include // for id #include // for marray -#include // for vec +#include // for vec #include // for assert #include // for CHAR_BIT diff --git a/sycl/include/sycl/group_algorithm.hpp b/sycl/include/sycl/group_algorithm.hpp index ac2950be0bb3f..dd0b2e4c1ef02 100644 --- a/sycl/include/sycl/group_algorithm.hpp +++ b/sycl/include/sycl/group_algorithm.hpp @@ -22,7 +22,7 @@ #include // for nd_item #include // for range #include // for sub_group -#include // for vec +#include // for vec #ifdef __SYCL_DEVICE_ONLY__ #include diff --git a/sycl/include/sycl/image.hpp b/sycl/include/sycl/image.hpp index a257239ace932..8d9b77cf0e697 100644 --- a/sycl/include/sycl/image.hpp +++ b/sycl/include/sycl/image.hpp @@ -29,7 +29,7 @@ #include // for property_list #include // for range, rangeTo... #include // for image_sampler -#include // for vec +#include // for vec #include // for ur_native_hand... #include // for size_t, nullptr_t diff --git a/sycl/include/sycl/interop_handle.hpp b/sycl/include/sycl/interop_handle.hpp index 0c21564b75e6b..2e7408cf5c0f9 100644 --- a/sycl/include/sycl/interop_handle.hpp +++ b/sycl/include/sycl/interop_handle.hpp @@ -11,12 +11,12 @@ #include // for target, mode, place... #include // for AccessorBaseHost #include // for backend, backend_re... +#include // for buffer #include // for __SYCL_EXPORT #include // for getSyclObjImpl #include #include // for accessor_property_list #include // for image -#include // for buffer #include // for ur_mem_handle_t, ur... #include // for shared_ptr diff --git a/sycl/include/sycl/kernel.hpp b/sycl/include/sycl/kernel.hpp index 455d2a1b1703f..654373c104c85 100644 --- a/sycl/include/sycl/kernel.hpp +++ b/sycl/include/sycl/kernel.hpp @@ -17,9 +17,9 @@ #include // for bundle_state #include // for ur_native_handle_t -#include // for hash -#include // for size_t -#include // for shared_ptr, hash, opera... +#include // for size_t +#include // for shared_ptr, hash, opera... +#include // for hash namespace sycl { inline namespace _V1 { diff --git a/sycl/include/sycl/known_identity.hpp b/sycl/include/sycl/known_identity.hpp index 89b1bae190c0f..92c3db7959a44 100644 --- a/sycl/include/sycl/known_identity.hpp +++ b/sycl/include/sycl/known_identity.hpp @@ -13,7 +13,7 @@ #include // for bit_and, bit_or, bit_xor #include // for half #include // for marray -#include // for vec +#include // for vec #include // for byte, size_t #include // for logical_and, logical_or diff --git a/sycl/include/sycl/stream.hpp b/sycl/include/sycl/stream.hpp index 5d1d06ab9eaa6..3d35147edb29c 100644 --- a/sycl/include/sycl/stream.hpp +++ b/sycl/include/sycl/stream.hpp @@ -29,7 +29,7 @@ #include // for property_list #include // for range #include // for multi_ptr -#include // for vec, SwizzleOp +#include // for vec, SwizzleOp #include // for size_t, byte #include // for hash, shared_ptr diff --git a/sycl/include/sycl/sycl.hpp b/sycl/include/sycl/sycl.hpp index 755cfd94c0227..aac1b2756f932 100644 --- a/sycl/include/sycl/sycl.hpp +++ b/sycl/include/sycl/sycl.hpp @@ -53,15 +53,14 @@ #include #include #include -#include #include #include #include +#include #include #if SYCL_EXT_ONEAPI_BACKEND_LEVEL_ZERO #include #endif -#include #include #include #include @@ -95,6 +94,7 @@ #include #include #include +#include #include #include #include diff --git a/sycl/source/detail/buffer_impl.hpp b/sycl/source/detail/buffer_impl.hpp index f7a7e0999344d..be3a529f17718 100644 --- a/sycl/source/detail/buffer_impl.hpp +++ b/sycl/source/detail/buffer_impl.hpp @@ -17,7 +17,6 @@ #include // for iterator_to_const_type_t #include #include -#include #include #include diff --git a/sycl/test-e2e/Basic/buffer/buffer.cpp b/sycl/test-e2e/Basic/buffer/buffer.cpp index 7c32c47cc570e..e0676207b4efe 100644 --- a/sycl/test-e2e/Basic/buffer/buffer.cpp +++ b/sycl/test-e2e/Basic/buffer/buffer.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include using namespace sycl; diff --git a/sycl/test-e2e/Basic/group_async_copy.cpp b/sycl/test-e2e/Basic/group_async_copy.cpp index 2eceadd3e9898..fc75189d147f2 100644 --- a/sycl/test-e2e/Basic/group_async_copy.cpp +++ b/sycl/test-e2e/Basic/group_async_copy.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include using namespace sycl; diff --git a/sycl/test-e2e/Basic/group_async_copy_legacy.cpp b/sycl/test-e2e/Basic/group_async_copy_legacy.cpp index ac5fac91e0cdb..9b2279fdcbb83 100644 --- a/sycl/test-e2e/Basic/group_async_copy_legacy.cpp +++ b/sycl/test-e2e/Basic/group_async_copy_legacy.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include using namespace sycl; diff --git a/sycl/test-e2e/Basic/half_type.cpp b/sycl/test-e2e/Basic/half_type.cpp index 4a1a43af90448..930e46b85040a 100644 --- a/sycl/test-e2e/Basic/half_type.cpp +++ b/sycl/test-e2e/Basic/half_type.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include using namespace sycl; diff --git a/sycl/test-e2e/Basic/parallel_for_indexers.cpp b/sycl/test-e2e/Basic/parallel_for_indexers.cpp index 3c41ac04fc8b1..59dbf3329e82d 100644 --- a/sycl/test-e2e/Basic/parallel_for_indexers.cpp +++ b/sycl/test-e2e/Basic/parallel_for_indexers.cpp @@ -2,7 +2,7 @@ // RUN: %{run} %t2.out #include -#include +#include #include #include diff --git a/sycl/test-e2e/Basic/parallel_for_range_roundup.cpp b/sycl/test-e2e/Basic/parallel_for_range_roundup.cpp index 0a1d7e81fd054..762dd1485353f 100644 --- a/sycl/test-e2e/Basic/parallel_for_range_roundup.cpp +++ b/sycl/test-e2e/Basic/parallel_for_range_roundup.cpp @@ -24,7 +24,7 @@ // #include #include -#include +#include using namespace sycl; diff --git a/sycl/test-e2e/Basic/swizzle_op.cpp b/sycl/test-e2e/Basic/swizzle_op.cpp index 9e96c51f9483f..0d800faa5769b 100644 --- a/sycl/test-e2e/Basic/swizzle_op.cpp +++ b/sycl/test-e2e/Basic/swizzle_op.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include using namespace sycl; diff --git a/sycl/test-e2e/Basic/vector/bool.cpp b/sycl/test-e2e/Basic/vector/bool.cpp index 51934c41b070c..3e48b0fbcfa4a 100644 --- a/sycl/test-e2e/Basic/vector/bool.cpp +++ b/sycl/test-e2e/Basic/vector/bool.cpp @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #include -#include +#include constexpr int size = 2; diff --git a/sycl/test-e2e/Basic/vector/byte.cpp b/sycl/test-e2e/Basic/vector/byte.cpp index 10c8e097d34ed..5100962c42038 100644 --- a/sycl/test-e2e/Basic/vector/byte.cpp +++ b/sycl/test-e2e/Basic/vector/byte.cpp @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #include -#include +#include #include // std::byte #include // std::ignore diff --git a/sycl/test-e2e/Basic/vector/int-convert.cpp b/sycl/test-e2e/Basic/vector/int-convert.cpp index 5af5911d3b7eb..5adef13979e7a 100644 --- a/sycl/test-e2e/Basic/vector/int-convert.cpp +++ b/sycl/test-e2e/Basic/vector/int-convert.cpp @@ -11,7 +11,7 @@ // RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %} #include -#include +#include #include #include diff --git a/sycl/test-e2e/Basic/vector/load_store.cpp b/sycl/test-e2e/Basic/vector/load_store.cpp index 626fd0264fb71..df4af3976a1ed 100644 --- a/sycl/test-e2e/Basic/vector/load_store.cpp +++ b/sycl/test-e2e/Basic/vector/load_store.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include namespace syclex = sycl::ext::oneapi; diff --git a/sycl/test-e2e/Basic/vector/operators.cpp b/sycl/test-e2e/Basic/vector/operators.cpp index 99f1f251762e9..f45c6e8e49e79 100644 --- a/sycl/test-e2e/Basic/vector/operators.cpp +++ b/sycl/test-e2e/Basic/vector/operators.cpp @@ -11,7 +11,7 @@ #define SYCL_SIMPLE_SWIZZLES #include -#include +#include namespace s = sycl; template diff --git a/sycl/test-e2e/Basic/vector/scalar_access.cpp b/sycl/test-e2e/Basic/vector/scalar_access.cpp index 2c474c07e64cc..8b67b5fb8faeb 100644 --- a/sycl/test-e2e/Basic/vector/scalar_access.cpp +++ b/sycl/test-e2e/Basic/vector/scalar_access.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include typedef float float4_t __attribute__((ext_vector_type(4))); diff --git a/sycl/test-e2e/Basic/vector/vec_binary_scalar_order.hpp b/sycl/test-e2e/Basic/vector/vec_binary_scalar_order.hpp index c9f0876366305..3d825665a7690 100644 --- a/sycl/test-e2e/Basic/vector/vec_binary_scalar_order.hpp +++ b/sycl/test-e2e/Basic/vector/vec_binary_scalar_order.hpp @@ -3,7 +3,7 @@ #pragma once #include -#include +#include template using rel_t = std::conditional_t< diff --git a/sycl/test-e2e/Regression/get_spec_const_vec16.cpp b/sycl/test-e2e/Regression/get_spec_const_vec16.cpp index fc9437c2c79d9..e851d2fe1d1e5 100644 --- a/sycl/test-e2e/Regression/get_spec_const_vec16.cpp +++ b/sycl/test-e2e/Regression/get_spec_const_vec16.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include diff --git a/sycl/test-e2e/Regression/group.cpp b/sycl/test-e2e/Regression/group.cpp index d906c3500a095..5c1d256550c0c 100644 --- a/sycl/test-e2e/Regression/group.cpp +++ b/sycl/test-e2e/Regression/group.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include using namespace sycl; diff --git a/sycl/test-e2e/Regression/local-arg-align.cpp b/sycl/test-e2e/Regression/local-arg-align.cpp index 8bed2ddb2074d..40a4e4f1e2998 100644 --- a/sycl/test-e2e/Regression/local-arg-align.cpp +++ b/sycl/test-e2e/Regression/local-arg-align.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include using namespace sycl; diff --git a/sycl/test-e2e/Regression/swizzle_opassign.cpp b/sycl/test-e2e/Regression/swizzle_opassign.cpp index 1d52cdc397c36..fb9ae6c648811 100644 --- a/sycl/test-e2e/Regression/swizzle_opassign.cpp +++ b/sycl/test-e2e/Regression/swizzle_opassign.cpp @@ -7,7 +7,7 @@ // and correctly mutate the elements in the corresponding vector. #include -#include +#include #include constexpr std::string_view OpNames[] = { diff --git a/sycl/test-e2e/Regression/vec_rel_swizzle_ops.cpp b/sycl/test-e2e/Regression/vec_rel_swizzle_ops.cpp index aca726b62cbb6..6184f0905f86a 100644 --- a/sycl/test-e2e/Regression/vec_rel_swizzle_ops.cpp +++ b/sycl/test-e2e/Regression/vec_rel_swizzle_ops.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include template bool testAndOperator(const std::string &typeName) { diff --git a/sycl/test/abi/layout_vec.cpp b/sycl/test/abi/layout_vec.cpp index db3b724d1873c..ade053f068f30 100644 --- a/sycl/test/abi/layout_vec.cpp +++ b/sycl/test/abi/layout_vec.cpp @@ -6,7 +6,7 @@ // clang-format off -#include +#include SYCL_EXTERNAL void foo(sycl::vec) {} diff --git a/sycl/test/abi/symbol_size_alignment.cpp b/sycl/test/abi/symbol_size_alignment.cpp index 03ab7022045c6..63286da1b9786 100644 --- a/sycl/test/abi/symbol_size_alignment.cpp +++ b/sycl/test/abi/symbol_size_alignment.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include using namespace sycl; diff --git a/sycl/test/basic_tests/interop-level-zero-2020.cpp b/sycl/test/basic_tests/interop-level-zero-2020.cpp index 1a39b8acb16b1..89267bbb63923 100644 --- a/sycl/test/basic_tests/interop-level-zero-2020.cpp +++ b/sycl/test/basic_tests/interop-level-zero-2020.cpp @@ -7,6 +7,7 @@ #include +#include #include #include diff --git a/sycl/test/basic_tests/vectors/size_one_checks.cpp b/sycl/test/basic_tests/vectors/size_one_checks.cpp index bca51592f8eeb..c1dbb7bfa20e0 100644 --- a/sycl/test/basic_tests/vectors/size_one_checks.cpp +++ b/sycl/test/basic_tests/vectors/size_one_checks.cpp @@ -3,7 +3,7 @@ // RUN: %if preview-breaking-changes-supported %{ %clangxx -fsycl -fpreview-breaking-changes %s -o %t_vec.out %} // RUN: %if preview-breaking-changes-supported %{ %t_vec.out %} -#include +#include int main() { sycl::vec v1{42}; diff --git a/sycl/test/check_device_code/vector/vector_convert_bfloat.cpp b/sycl/test/check_device_code/vector/vector_convert_bfloat.cpp index a4c9c185614a2..ba48bd4145930 100644 --- a/sycl/test/check_device_code/vector/vector_convert_bfloat.cpp +++ b/sycl/test/check_device_code/vector/vector_convert_bfloat.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include using namespace sycl; using bfloat16 = sycl::ext::oneapi::bfloat16; From ca99f2dd557d0be017015ac21450a814cfecef68 Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Fri, 8 Nov 2024 07:02:13 -0800 Subject: [PATCH 3/9] More build fixes & clang-format --- libdevice/nativecpu_utils.cpp | 2 +- sycl/include/sycl/builtins_utils_vec.hpp | 4 ++-- .../sycl/ext/oneapi/experimental/non_uniform_groups.hpp | 2 +- sycl/test-e2e/Regression/swizzle_opassign.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libdevice/nativecpu_utils.cpp b/libdevice/nativecpu_utils.cpp index 65e6c4c1fd0d1..c3e8bb61657a7 100644 --- a/libdevice/nativecpu_utils.cpp +++ b/libdevice/nativecpu_utils.cpp @@ -17,7 +17,7 @@ #include "device.h" #include #include -#include +#include // including state definition from Native CPU UR adapter #include "nativecpu_state.hpp" diff --git a/sycl/include/sycl/builtins_utils_vec.hpp b/sycl/include/sycl/builtins_utils_vec.hpp index 3c1d429a816db..1a2304ce59023 100644 --- a/sycl/include/sycl/builtins_utils_vec.hpp +++ b/sycl/include/sycl/builtins_utils_vec.hpp @@ -13,8 +13,8 @@ #include #include -#include // for marray -#include // for vec +#include // for marray +#include // for vec namespace sycl { inline namespace _V1 { diff --git a/sycl/include/sycl/ext/oneapi/experimental/non_uniform_groups.hpp b/sycl/include/sycl/ext/oneapi/experimental/non_uniform_groups.hpp index d201a3374cbe0..bbe619834dcdc 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/non_uniform_groups.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/non_uniform_groups.hpp @@ -10,7 +10,7 @@ #include // for sub_group_mask #include // for marray -#include // for vec +#include // for vec #include // for size_t #include // for uint32_t diff --git a/sycl/test-e2e/Regression/swizzle_opassign.cpp b/sycl/test-e2e/Regression/swizzle_opassign.cpp index fb9ae6c648811..f8ee858edd655 100644 --- a/sycl/test-e2e/Regression/swizzle_opassign.cpp +++ b/sycl/test-e2e/Regression/swizzle_opassign.cpp @@ -7,8 +7,8 @@ // and correctly mutate the elements in the corresponding vector. #include -#include #include +#include constexpr std::string_view OpNames[] = { "+=", "-=", "*=", "/=", "%=", "&=", "|=", From 9abc2f3740d387e6039217431006342da6ea6b2a Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Fri, 8 Nov 2024 07:52:02 -0800 Subject: [PATCH 4/9] Hopefully, final fixes to see CI pass --- sycl/source/detail/platform_impl.hpp | 1 + sycl/test/CMakeLists.txt | 1 - sycl/test/basic_tests/interop-backend-traits-cuda.cpp | 1 + sycl/test/basic_tests/interop-cuda.cpp | 1 + 4 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sycl/source/detail/platform_impl.hpp b/sycl/source/detail/platform_impl.hpp index 982e619f4555a..e7e76334efaa6 100644 --- a/sycl/source/detail/platform_impl.hpp +++ b/sycl/source/detail/platform_impl.hpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include diff --git a/sycl/test/CMakeLists.txt b/sycl/test/CMakeLists.txt index be2332d4a4c8a..a0a2ffe034448 100644 --- a/sycl/test/CMakeLists.txt +++ b/sycl/test/CMakeLists.txt @@ -15,7 +15,6 @@ set(SYCL_THREADS_LIB ${CMAKE_THREAD_LIBS_INIT}) # TEST_INCLUDE_PATH is used for syntax-only verification of type information. list(APPEND test_includes ${SYCL_INCLUDE}) -list(APPEND test_includes ${SYCL_INCLUDE}/sycl) list(APPEND test_includes ${SYCL_SOURCE_DIR}/source) list(APPEND test_includes ${BOOST_UNORDERED_INCLUDE_DIRS}) if(SYCL_ENABLE_EXTENSION_JIT) diff --git a/sycl/test/basic_tests/interop-backend-traits-cuda.cpp b/sycl/test/basic_tests/interop-backend-traits-cuda.cpp index 2a1b163dea9c0..147adc1535ef9 100644 --- a/sycl/test/basic_tests/interop-backend-traits-cuda.cpp +++ b/sycl/test/basic_tests/interop-backend-traits-cuda.cpp @@ -5,6 +5,7 @@ #ifdef USE_CUDA_EXPERIMENTAL #define SYCL_EXT_ONEAPI_BACKEND_CUDA 1 #define SYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL 1 +#include #include #endif diff --git a/sycl/test/basic_tests/interop-cuda.cpp b/sycl/test/basic_tests/interop-cuda.cpp index 6a5ae5a027949..781e432a8bfd9 100644 --- a/sycl/test/basic_tests/interop-cuda.cpp +++ b/sycl/test/basic_tests/interop-cuda.cpp @@ -10,6 +10,7 @@ #ifdef SYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL // expected-no-diagnostics +#include #include #endif From 333be7bc09d5cbfa8a62e65ec3f8070ab79f7f85 Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Fri, 8 Nov 2024 08:12:20 -0800 Subject: [PATCH 5/9] Fix Win build --- sycl/source/detail/composite_device/composite_device.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sycl/source/detail/composite_device/composite_device.cpp b/sycl/source/detail/composite_device/composite_device.cpp index 71e43bd0a8e0f..3e38c057eed76 100644 --- a/sycl/source/detail/composite_device/composite_device.cpp +++ b/sycl/source/detail/composite_device/composite_device.cpp @@ -11,6 +11,7 @@ #include #include +#include namespace sycl { inline namespace _V1 { From 55893cc54c632890e93b98c3ea94b2586ad09f18 Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Fri, 8 Nov 2024 08:21:57 -0800 Subject: [PATCH 6/9] clang-format --- sycl/source/detail/composite_device/composite_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/source/detail/composite_device/composite_device.cpp b/sycl/source/detail/composite_device/composite_device.cpp index 3e38c057eed76..f3eb568a6f4a0 100644 --- a/sycl/source/detail/composite_device/composite_device.cpp +++ b/sycl/source/detail/composite_device/composite_device.cpp @@ -10,8 +10,8 @@ #include #include -#include #include +#include namespace sycl { inline namespace _V1 { From 75a9060c9d41abfb1ae8d29317f07de8677f1ffc Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Fri, 8 Nov 2024 09:42:10 -0800 Subject: [PATCH 7/9] Avoid some questionable changes --- sycl/include/sycl/backend.hpp | 9 +++++++++ sycl/include/sycl/backend_types.hpp | 10 +--------- sycl/include/sycl/ext/oneapi/backend/level_zero.hpp | 2 +- .../sycl/ext/oneapi/experimental/backend/cuda.hpp | 2 +- sycl/include/sycl/sycl.hpp | 6 +++--- sycl/test/basic_tests/interop-backend-traits-cuda.cpp | 1 - sycl/test/basic_tests/interop-cuda.cpp | 1 - sycl/test/basic_tests/interop-level-zero-2020.cpp | 1 - sycl/test/include_deps/sycl_accessor.hpp.cpp | 1 - sycl/test/include_deps/sycl_buffer.hpp.cpp | 1 - sycl/test/include_deps/sycl_detail_core.hpp.cpp | 1 - 11 files changed, 15 insertions(+), 20 deletions(-) diff --git a/sycl/include/sycl/backend.hpp b/sycl/include/sycl/backend.hpp index 2b2380612c926..fc477128b57b4 100644 --- a/sycl/include/sycl/backend.hpp +++ b/sycl/include/sycl/backend.hpp @@ -64,6 +64,15 @@ namespace detail { enum class backend_errc : unsigned int {}; } // namespace detail +template class backend_traits { +public: + template + using input_type = typename detail::BackendInput::type; + + template + using return_type = typename detail::BackendReturn::type; +}; + namespace detail { template struct BufferInterop { diff --git a/sycl/include/sycl/backend_types.hpp b/sycl/include/sycl/backend_types.hpp index 51802cfebade6..c0a274febc9e7 100644 --- a/sycl/include/sycl/backend_types.hpp +++ b/sycl/include/sycl/backend_types.hpp @@ -8,7 +8,6 @@ #pragma once -#include #include // for __SYCL2020_DEPRECATED #include // for operator<<, ostream @@ -28,14 +27,7 @@ enum class backend : char { ext_oneapi_native_cpu = 7, }; -template class backend_traits { -public: - template - using input_type = typename detail::BackendInput::type; - - template - using return_type = typename detail::BackendReturn::type; -}; +template class backend_traits; template using backend_input_t = diff --git a/sycl/include/sycl/ext/oneapi/backend/level_zero.hpp b/sycl/include/sycl/ext/oneapi/backend/level_zero.hpp index dec7d78ea1011..14969a309e4da 100644 --- a/sycl/include/sycl/ext/oneapi/backend/level_zero.hpp +++ b/sycl/include/sycl/ext/oneapi/backend/level_zero.hpp @@ -9,7 +9,7 @@ #pragma once #include // for async_han... -#include // for backend +#include // for backend #include // for buffer_al... #include // for buffer #include // for context diff --git a/sycl/include/sycl/ext/oneapi/experimental/backend/cuda.hpp b/sycl/include/sycl/ext/oneapi/experimental/backend/cuda.hpp index 7d5a18b85e5b6..4412c5c1a0c23 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/backend/cuda.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/backend/cuda.hpp @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include diff --git a/sycl/include/sycl/sycl.hpp b/sycl/include/sycl/sycl.hpp index aac1b2756f932..2721aaa176f19 100644 --- a/sycl/include/sycl/sycl.hpp +++ b/sycl/include/sycl/sycl.hpp @@ -19,6 +19,9 @@ #if SYCL_BACKEND_OPENCL #include #endif +#if SYCL_EXT_ONEAPI_BACKEND_LEVEL_ZERO +#include +#endif #include #include #include @@ -58,9 +61,6 @@ #include #include #include -#if SYCL_EXT_ONEAPI_BACKEND_LEVEL_ZERO -#include -#endif #include #include #include diff --git a/sycl/test/basic_tests/interop-backend-traits-cuda.cpp b/sycl/test/basic_tests/interop-backend-traits-cuda.cpp index 147adc1535ef9..2a1b163dea9c0 100644 --- a/sycl/test/basic_tests/interop-backend-traits-cuda.cpp +++ b/sycl/test/basic_tests/interop-backend-traits-cuda.cpp @@ -5,7 +5,6 @@ #ifdef USE_CUDA_EXPERIMENTAL #define SYCL_EXT_ONEAPI_BACKEND_CUDA 1 #define SYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL 1 -#include #include #endif diff --git a/sycl/test/basic_tests/interop-cuda.cpp b/sycl/test/basic_tests/interop-cuda.cpp index 781e432a8bfd9..6a5ae5a027949 100644 --- a/sycl/test/basic_tests/interop-cuda.cpp +++ b/sycl/test/basic_tests/interop-cuda.cpp @@ -10,7 +10,6 @@ #ifdef SYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL // expected-no-diagnostics -#include #include #endif diff --git a/sycl/test/basic_tests/interop-level-zero-2020.cpp b/sycl/test/basic_tests/interop-level-zero-2020.cpp index 89267bbb63923..1a39b8acb16b1 100644 --- a/sycl/test/basic_tests/interop-level-zero-2020.cpp +++ b/sycl/test/basic_tests/interop-level-zero-2020.cpp @@ -7,7 +7,6 @@ #include -#include #include #include diff --git a/sycl/test/include_deps/sycl_accessor.hpp.cpp b/sycl/test/include_deps/sycl_accessor.hpp.cpp index d54156de82c55..9590fc164ef30 100644 --- a/sycl/test/include_deps/sycl_accessor.hpp.cpp +++ b/sycl/test/include_deps/sycl_accessor.hpp.cpp @@ -57,7 +57,6 @@ // CHECK-NEXT: info/aspects_deprecated.def // CHECK-NEXT: buffer.hpp // CHECK-NEXT: backend_types.hpp -// CHECK-NEXT: detail/backend_traits.hpp // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/string.hpp diff --git a/sycl/test/include_deps/sycl_buffer.hpp.cpp b/sycl/test/include_deps/sycl_buffer.hpp.cpp index bf43891c87a37..0c38ee6bde31c 100644 --- a/sycl/test/include_deps/sycl_buffer.hpp.cpp +++ b/sycl/test/include_deps/sycl_buffer.hpp.cpp @@ -12,7 +12,6 @@ // CHECK-NEXT: detail/defines.hpp // CHECK-NEXT: detail/export.hpp // CHECK-NEXT: backend_types.hpp -// CHECK-NEXT: detail/backend_traits.hpp // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/string.hpp diff --git a/sycl/test/include_deps/sycl_detail_core.hpp.cpp b/sycl/test/include_deps/sycl_detail_core.hpp.cpp index 22061fd4a89f7..37183c3a0c4e8 100644 --- a/sycl/test/include_deps/sycl_detail_core.hpp.cpp +++ b/sycl/test/include_deps/sycl_detail_core.hpp.cpp @@ -58,7 +58,6 @@ // CHECK-NEXT: info/aspects_deprecated.def // CHECK-NEXT: buffer.hpp // CHECK-NEXT: backend_types.hpp -// CHECK-NEXT: detail/backend_traits.hpp // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/string.hpp From df4ae3ef53ef08e8de000284b7b8ada36caf5474 Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Fri, 8 Nov 2024 09:48:47 -0800 Subject: [PATCH 8/9] Restore more unnecessary changes and clang-format --- sycl/include/sycl/platform.hpp | 3 +++ sycl/include/sycl/sycl.hpp | 1 + 2 files changed, 4 insertions(+) diff --git a/sycl/include/sycl/platform.hpp b/sycl/include/sycl/platform.hpp index 7fa167a062a0a..ec57731141b32 100644 --- a/sycl/include/sycl/platform.hpp +++ b/sycl/include/sycl/platform.hpp @@ -38,6 +38,9 @@ inline namespace _V1 { class device; class context; +template +auto get_native(const SyclObjectT &Obj) + -> backend_return_t; namespace detail { class platform_impl; diff --git a/sycl/include/sycl/sycl.hpp b/sycl/include/sycl/sycl.hpp index 2721aaa176f19..603978787a817 100644 --- a/sycl/include/sycl/sycl.hpp +++ b/sycl/include/sycl/sycl.hpp @@ -61,6 +61,7 @@ #include #include #include + #include #include #include From b38ceed5718bbecb7ef866cba66e4651f6ef560f Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Sat, 9 Nov 2024 02:49:02 -0800 Subject: [PATCH 9/9] Apply offline comments about vector.hpp & vector_convert.hpp --- sycl/include/sycl/builtins_utils_vec.hpp | 1 + sycl/include/sycl/detail/vector_convert.hpp | 2 ++ .../include/sycl/ext/oneapi/experimental/bfloat16_math.hpp | 7 ++++--- sycl/include/sycl/sycl.hpp | 1 + sycl/include/sycl/vector.hpp | 3 --- sycl/source/detail/image_accessor_util.cpp | 1 + sycl/test-e2e/BFloat16/bfloat16_vec.cpp | 1 + sycl/test-e2e/Basic/sycl_2020_images/common.hpp | 1 + sycl/test-e2e/Basic/vector/bool.cpp | 1 + sycl/test-e2e/Basic/vector/byte.cpp | 1 + sycl/test-e2e/Basic/vector/int-convert.cpp | 1 + .../test/check_device_code/vector/vector_bf16_builtins.cpp | 1 + .../check_device_code/vector/vector_convert_bfloat.cpp | 1 + 13 files changed, 16 insertions(+), 6 deletions(-) diff --git a/sycl/include/sycl/builtins_utils_vec.hpp b/sycl/include/sycl/builtins_utils_vec.hpp index 1a2304ce59023..9504b8d3aa295 100644 --- a/sycl/include/sycl/builtins_utils_vec.hpp +++ b/sycl/include/sycl/builtins_utils_vec.hpp @@ -13,6 +13,7 @@ #include #include +#include #include // for marray #include // for vec diff --git a/sycl/include/sycl/detail/vector_convert.hpp b/sycl/include/sycl/detail/vector_convert.hpp index d8262f9d1aaec..c4bd584be80da 100644 --- a/sycl/include/sycl/detail/vector_convert.hpp +++ b/sycl/include/sycl/detail/vector_convert.hpp @@ -58,6 +58,7 @@ #include // for errc #include // bfloat16 +#include #ifndef __SYCL_DEVICE_ONLY__ #include // for fesetround, fegetround @@ -152,6 +153,7 @@ __imf_ushort_as_bfloat16(unsigned short x); #endif // __SYCL_DEVICE_ONLY__ && (defined(__SPIR__) || defined(__SPIRV__)) namespace sycl { + inline namespace _V1 { #ifndef __SYCL_DEVICE_ONLY__ // TODO: Refactor includes so we can just "#include". diff --git a/sycl/include/sycl/ext/oneapi/experimental/bfloat16_math.hpp b/sycl/include/sycl/ext/oneapi/experimental/bfloat16_math.hpp index ed513ae3d2098..f82014fe3e209 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/bfloat16_math.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/bfloat16_math.hpp @@ -8,9 +8,10 @@ #pragma once -#include // for ceil, cos, exp, exp10, exp2 -#include // For simplify_if_swizzle, is_swizzle -#include // sycl::detail::memcpy +#include // for ceil, cos, exp, exp10, exp2 +#include // For simplify_if_swizzle, is_swizzle +#include // sycl::detail::memcpy +#include #include // for bfloat16, bfloat16ToBits #include // for marray diff --git a/sycl/include/sycl/sycl.hpp b/sycl/include/sycl/sycl.hpp index 603978787a817..73aa4421d0caa 100644 --- a/sycl/include/sycl/sycl.hpp +++ b/sycl/include/sycl/sycl.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/sycl/include/sycl/vector.hpp b/sycl/include/sycl/vector.hpp index 9d07b84193564..97d9704c3cc26 100644 --- a/sycl/include/sycl/vector.hpp +++ b/sycl/include/sycl/vector.hpp @@ -360,7 +360,6 @@ class __SYCL_EBO vec public: // Out-of-class definition is in `sycl/detail/vector_convert.hpp` - // It is included at the _end_ of this file template vec convert() const; @@ -1317,5 +1316,3 @@ class SwizzleOp { } // namespace detail } // namespace _V1 } // namespace sycl - -#include diff --git a/sycl/source/detail/image_accessor_util.cpp b/sycl/source/detail/image_accessor_util.cpp index 82d63d5b4fdc7..88ca0d1f58178 100644 --- a/sycl/source/detail/image_accessor_util.cpp +++ b/sycl/source/detail/image_accessor_util.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include namespace sycl { diff --git a/sycl/test-e2e/BFloat16/bfloat16_vec.cpp b/sycl/test-e2e/BFloat16/bfloat16_vec.cpp index 50364541f4272..6b95296c64c7b 100644 --- a/sycl/test-e2e/BFloat16/bfloat16_vec.cpp +++ b/sycl/test-e2e/BFloat16/bfloat16_vec.cpp @@ -15,6 +15,7 @@ // RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %} #include +#include #include #include diff --git a/sycl/test-e2e/Basic/sycl_2020_images/common.hpp b/sycl/test-e2e/Basic/sycl_2020_images/common.hpp index b5b97a66d2f2f..4433d3d3216b0 100644 --- a/sycl/test-e2e/Basic/sycl_2020_images/common.hpp +++ b/sycl/test-e2e/Basic/sycl_2020_images/common.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #include using namespace sycl; diff --git a/sycl/test-e2e/Basic/vector/bool.cpp b/sycl/test-e2e/Basic/vector/bool.cpp index 3e48b0fbcfa4a..b440f65e3261e 100644 --- a/sycl/test-e2e/Basic/vector/bool.cpp +++ b/sycl/test-e2e/Basic/vector/bool.cpp @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include +#include #include constexpr int size = 2; diff --git a/sycl/test-e2e/Basic/vector/byte.cpp b/sycl/test-e2e/Basic/vector/byte.cpp index 5100962c42038..6eadf6a177b7b 100644 --- a/sycl/test-e2e/Basic/vector/byte.cpp +++ b/sycl/test-e2e/Basic/vector/byte.cpp @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include +#include #include #include // std::byte diff --git a/sycl/test-e2e/Basic/vector/int-convert.cpp b/sycl/test-e2e/Basic/vector/int-convert.cpp index 5adef13979e7a..ba5060292a164 100644 --- a/sycl/test-e2e/Basic/vector/int-convert.cpp +++ b/sycl/test-e2e/Basic/vector/int-convert.cpp @@ -11,6 +11,7 @@ // RUN: %if preview-breaking-changes-supported %{ %{run} %t2.out %} #include +#include #include #include diff --git a/sycl/test/check_device_code/vector/vector_bf16_builtins.cpp b/sycl/test/check_device_code/vector/vector_bf16_builtins.cpp index 517bcba4c3732..891c79a1a8f94 100644 --- a/sycl/test/check_device_code/vector/vector_bf16_builtins.cpp +++ b/sycl/test/check_device_code/vector/vector_bf16_builtins.cpp @@ -13,6 +13,7 @@ // This test checks the device code generated for vec math builtins. #include +#include #include using namespace sycl; diff --git a/sycl/test/check_device_code/vector/vector_convert_bfloat.cpp b/sycl/test/check_device_code/vector/vector_convert_bfloat.cpp index ba48bd4145930..a60d239be2ba1 100644 --- a/sycl/test/check_device_code/vector/vector_convert_bfloat.cpp +++ b/sycl/test/check_device_code/vector/vector_convert_bfloat.cpp @@ -5,6 +5,7 @@ // REQUIRES: linux #include +#include #include #include