diff --git a/sycl/include/sycl/detail/common.hpp b/sycl/include/sycl/detail/common.hpp index 3383719c3fce1..91a87cc56dd36 100644 --- a/sycl/include/sycl/detail/common.hpp +++ b/sycl/include/sycl/detail/common.hpp @@ -9,7 +9,9 @@ #pragma once #ifndef __INTEL_PREVIEW_BREAKING_CHANGES -#include // for sycl::exception, sycl::errc +#ifndef __SYCL_DEVICE_ONLY__ +#include +#endif #endif // #ifndef __INTEL_PREVIEW_BREAKING_CHANGES #include // for __SYCL_ALWAYS_INLINE #include // for __SYCL_EXPORT @@ -159,8 +161,10 @@ class __SYCL_EXPORT tls_code_loc_t { // Should never be called. In PREVIEW we marked it as deleted, but // before ABI breaking change we need to keep it for backward compatibility. assert(false && "tls_code_loc_t should not be copied"); +#ifndef __SYCL_DEVICE_ONLY__ throw sycl::exception(sycl::make_error_code(sycl::errc::invalid), "tls_code_loc_t should not be copied"); +#endif return *this; } #endif // __INTEL_PREVIEW_BREAKING_CHANGES @@ -200,8 +204,6 @@ class __SYCL_EXPORT tls_code_loc_t { std::string(sycl::detail::get_backend_name_no_vendor(backend)) + \ " backend failed with error: " -#include - namespace sycl { inline namespace _V1 { namespace detail { diff --git a/sycl/include/sycl/detail/kernel_launch_helper.hpp b/sycl/include/sycl/detail/kernel_launch_helper.hpp index 254084a36adbb..a80ddc9feb83f 100644 --- a/sycl/include/sycl/detail/kernel_launch_helper.hpp +++ b/sycl/include/sycl/detail/kernel_launch_helper.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/sycl/include/sycl/ext/oneapi/experimental/annotated_arg/annotated_arg.hpp b/sycl/include/sycl/ext/oneapi/experimental/annotated_arg/annotated_arg.hpp index b71f4fc4e0f08..b4df7a421b5e3 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/annotated_arg/annotated_arg.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/annotated_arg/annotated_arg.hpp @@ -9,6 +9,7 @@ #pragma once #include +#include #include #include #include diff --git a/sycl/include/sycl/ext/oneapi/properties/properties.hpp b/sycl/include/sycl/ext/oneapi/properties/properties.hpp index 4d3e11ec8b143..c7770e228bde8 100644 --- a/sycl/include/sycl/ext/oneapi/properties/properties.hpp +++ b/sycl/include/sycl/ext/oneapi/properties/properties.hpp @@ -8,7 +8,6 @@ #pragma once -#include #include #include // for IsRuntimePr... #include // for Sorted, Mer... diff --git a/sycl/include/sycl/memory_enums.hpp b/sycl/include/sycl/memory_enums.hpp index 3a8886034c560..eb28e1515ab07 100644 --- a/sycl/include/sycl/memory_enums.hpp +++ b/sycl/include/sycl/memory_enums.hpp @@ -8,8 +8,9 @@ #pragma once +#ifndef __SYCL_DEVICE_ONLY__ #include // for memory_order -#include // for vector +#endif namespace sycl { inline namespace _V1 { diff --git a/sycl/include/sycl/nd_item.hpp b/sycl/include/sycl/nd_item.hpp index e983b868cce5c..fdc56691065fe 100644 --- a/sycl/include/sycl/nd_item.hpp +++ b/sycl/include/sycl/nd_item.hpp @@ -17,7 +17,6 @@ #include // for getSPIRVMemorySemanticsMask #include // for is_bool, change_base_... #include // for device_event -#include // for make_error_code, errc, exce... #include // for group #include // for id #include // for item diff --git a/sycl/include/sycl/sub_group.hpp b/sycl/include/sycl/sub_group.hpp index 520e54daac097..2270ed62a336c 100644 --- a/sycl/include/sycl/sub_group.hpp +++ b/sycl/include/sycl/sub_group.hpp @@ -14,16 +14,18 @@ #include #include // for select_cl_scalar_inte... #include // for is_scalar_arithmetic -#include // for exception, make_error... #include // for id #include // for memory_scope #include #include // for range #include // for uint32_t -#include // for _Swallow_assign, ignore #include // for enable_if_t, remove_cv_t +#ifndef __SYCL_DEVICE_ONLY__ +#include // for exception, make_error... +#endif + namespace sycl { inline namespace _V1 { namespace detail { diff --git a/sycl/test-e2e/syclcompat/atomic/atomic_class.cpp b/sycl/test-e2e/syclcompat/atomic/atomic_class.cpp index ed85a966b2429..abf5e7d5b9dc3 100644 --- a/sycl/test-e2e/syclcompat/atomic/atomic_class.cpp +++ b/sycl/test-e2e/syclcompat/atomic/atomic_class.cpp @@ -41,6 +41,8 @@ #include "../common.hpp" #include "atomic_fixt.hpp" +#include + constexpr size_t numBlocks = 1; constexpr size_t numThreads = 1; constexpr size_t numData = 6; diff --git a/sycl/test/include_deps/sycl_accessor.hpp.cpp b/sycl/test/include_deps/sycl_accessor.hpp.cpp index 59474a58c5fd7..ac2e85ac20cd5 100644 --- a/sycl/test/include_deps/sycl_accessor.hpp.cpp +++ b/sycl/test/include_deps/sycl_accessor.hpp.cpp @@ -12,9 +12,7 @@ // CHECK-NEXT: stl_wrappers/cstdlib // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: detail/common.hpp -// CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/export.hpp -// CHECK-NEXT: detail/string.hpp // CHECK-NEXT: stl_wrappers/cassert // CHECK-NEXT: stl_wrappers/assert.h // CHECK-NEXT: __spirv/spirv_vars.hpp @@ -35,6 +33,8 @@ // CHECK-NEXT: detail/os_util.hpp // CHECK-NEXT: ext/oneapi/accessor_property_list.hpp // CHECK-NEXT: detail/property_list_base.hpp +// CHECK-NEXT: exception.hpp +// CHECK-NEXT: detail/string.hpp // CHECK-NEXT: property_list.hpp // CHECK-NEXT: properties/property_traits.hpp // CHECK-NEXT: id.hpp diff --git a/sycl/test/include_deps/sycl_buffer.hpp.cpp b/sycl/test/include_deps/sycl_buffer.hpp.cpp index cc4537177202d..4b0d735321b6b 100644 --- a/sycl/test/include_deps/sycl_buffer.hpp.cpp +++ b/sycl/test/include_deps/sycl_buffer.hpp.cpp @@ -11,9 +11,7 @@ // CHECK-NEXT: stl_wrappers/cstdlib // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: detail/common.hpp -// CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/export.hpp -// CHECK-NEXT: detail/string.hpp // CHECK-NEXT: stl_wrappers/cassert // CHECK-NEXT: stl_wrappers/assert.h // CHECK-NEXT: __spirv/spirv_vars.hpp @@ -34,6 +32,8 @@ // CHECK-NEXT: detail/os_util.hpp // CHECK-NEXT: ext/oneapi/accessor_property_list.hpp // CHECK-NEXT: detail/property_list_base.hpp +// CHECK-NEXT: exception.hpp +// CHECK-NEXT: detail/string.hpp // CHECK-NEXT: property_list.hpp // CHECK-NEXT: properties/property_traits.hpp // CHECK-NEXT: id.hpp diff --git a/sycl/test/include_deps/sycl_detail_core.hpp.cpp b/sycl/test/include_deps/sycl_detail_core.hpp.cpp index 75c96a1adbceb..72eea7f16317c 100644 --- a/sycl/test/include_deps/sycl_detail_core.hpp.cpp +++ b/sycl/test/include_deps/sycl_detail_core.hpp.cpp @@ -13,9 +13,7 @@ // CHECK-NEXT: stl_wrappers/cstdlib // CHECK-NEXT: detail/array.hpp // CHECK-NEXT: detail/common.hpp -// CHECK-NEXT: exception.hpp // CHECK-NEXT: detail/export.hpp -// CHECK-NEXT: detail/string.hpp // CHECK-NEXT: stl_wrappers/cassert // CHECK-NEXT: stl_wrappers/assert.h // CHECK-NEXT: __spirv/spirv_vars.hpp @@ -36,6 +34,8 @@ // CHECK-NEXT: detail/os_util.hpp // CHECK-NEXT: ext/oneapi/accessor_property_list.hpp // CHECK-NEXT: detail/property_list_base.hpp +// CHECK-NEXT: exception.hpp +// CHECK-NEXT: detail/string.hpp // CHECK-NEXT: property_list.hpp // CHECK-NEXT: properties/property_traits.hpp // CHECK-NEXT: id.hpp