diff --git a/sycl/include/sycl/access/access.hpp b/sycl/include/sycl/access/access.hpp index 5cb5b7697412d..56943580ad81f 100644 --- a/sycl/include/sycl/access/access.hpp +++ b/sycl/include/sycl/access/access.hpp @@ -69,31 +69,12 @@ template struct mode_target_tag_t { explicit mode_target_tag_t() = default; }; -#if __cplusplus >= 201703L - inline constexpr mode_tag_t read_only{}; inline constexpr mode_tag_t read_write{}; inline constexpr mode_tag_t write_only{}; inline constexpr mode_target_tag_t read_constant{}; -#else - -namespace { - -constexpr const auto &read_only = - sycl::detail::InlineVariableHelper>::value; -constexpr const auto &read_write = sycl::detail::InlineVariableHelper< - mode_tag_t>::value; -constexpr const auto &write_only = - sycl::detail::InlineVariableHelper>::value; -constexpr const auto &read_constant = sycl::detail::InlineVariableHelper< - mode_target_tag_t>::value; - -} // namespace - -#endif - namespace detail { constexpr bool isTargetHostAccess(access::target T) { diff --git a/sycl/include/sycl/accessor.hpp b/sycl/include/sycl/accessor.hpp index c2ab5fb06db46..288cd82f9104f 100644 --- a/sycl/include/sycl/accessor.hpp +++ b/sycl/include/sycl/accessor.hpp @@ -250,11 +250,7 @@ struct AccHostDataT { // To ensure loop unrolling is done when processing dimensions. template void dim_loop_impl(std::integer_sequence, F &&f) { -#if __cplusplus >= 201703L (f(Inds), ...); -#else - (void)std::initializer_list{((void)(f(Inds)), 0)...}; -#endif } template void dim_loop(F &&f) { @@ -375,8 +371,6 @@ class accessor_common { }; }; -#if __cplusplus >= 201703L - template constexpr access::mode deduceAccessMode() { // property_list = {} is not properly detected by deduction guide, @@ -424,8 +418,6 @@ constexpr access::target deduceAccessTarget(access::target defaultTarget) { return defaultTarget; } -#endif - template class LocalAccessorBaseDevice { public: LocalAccessorBaseDevice(sycl::range Size) @@ -1038,14 +1030,10 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : // We've already adjusted for the accessor's offset in the __init, so // don't include it here in case of device. #ifndef __SYCL_DEVICE_ONLY__ -#if __cplusplus >= 201703L if constexpr (!(PropertyListT::template has_property< sycl::ext::oneapi::property::no_offset>())) { Result += getOffset()[I]; } -#else - Result += getOffset()[I]; -#endif #endif // __SYCL_DEVICE_ONLY__ }); @@ -1101,14 +1089,10 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : range MemRange, id Offset) { MData = Ptr; detail::dim_loop([&, this](size_t I) { -#if __cplusplus >= 201703L if constexpr (!(PropertyListT::template has_property< sycl::ext::oneapi::property::no_offset>())) { getOffset()[I] = Offset[I]; } -#else - getOffset()[I] = Offset[I]; -#endif getAccessRange()[I] = AccessRange[I]; getMemoryRange()[I] = MemRange[I]; }); @@ -1461,8 +1445,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : } #endif -#if __cplusplus >= 201703L - template = 201703L - template ::value && @@ -1619,8 +1596,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : const detail::code_location CodeLoc = detail::code_location::current()) : accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {} -#if __cplusplus >= 201703L - template = 201703L - template = 201703L - template = 201703L - template accessor( @@ -2001,12 +1966,10 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template 0)>> id get_offset() const { -#if __cplusplus >= 201703L static_assert( !(PropertyListT::template has_property< sycl::ext::oneapi::property::no_offset>()), "Accessor has no_offset property, get_offset() can not be used"); -#endif return detail::convertToArrayOfN(getOffset()); } @@ -2124,7 +2087,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : #endif } -#if __cplusplus >= 201703L template static constexpr bool has_property( typename std::enable_if_t< @@ -2138,7 +2100,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : ext::oneapi::is_compile_time_property::value> * = 0) { return PropertyListT::template get_property(); } -#endif bool operator==(const accessor &Rhs) const { return impl == Rhs.impl; } bool operator!=(const accessor &Rhs) const { return !(*this == Rhs); } @@ -2177,14 +2138,10 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : size_t TotalOffset = 0; detail::dim_loop([&, this](size_t I) { TotalOffset = TotalOffset * impl.MemRange[I]; -#if __cplusplus >= 201703L if constexpr (!(PropertyListT::template has_property< sycl::ext::oneapi::property::no_offset>())) { TotalOffset += impl.Offset[I]; } -#else - TotalOffset += impl.Offset[I]; -#endif }); return TotalOffset; @@ -2222,7 +2179,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : } } -#if __cplusplus >= 201703L template void adjustAccPropsInBuf(BufT &Buffer) { if constexpr (PropertyListT::template has_property< @@ -2242,11 +2198,8 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : Buffer.deleteAccProps( sycl::detail::PropWithDataKind::AccPropBufferLocation); } -#endif }; -#if __cplusplus >= 201703L - template accessor(buffer) -> accessor, handler &, Type1, Type2, Type3, detail::deduceAccessTarget(target::device), access::placeholder::false_t, ext::oneapi::accessor_property_list>; -#endif /// Local accessor /// @@ -3003,8 +2955,6 @@ class __SYCL_EBO host_accessor const detail::code_location CodeLoc = detail::code_location::current()) : AccessorT(BufferRef, PropertyList, CodeLoc) {} -#if __cplusplus >= 201703L - template ::value>> host_accessor( @@ -3013,7 +2963,6 @@ class __SYCL_EBO host_accessor const detail::code_location CodeLoc = detail::code_location::current()) : host_accessor(BufferRef, PropertyList, CodeLoc) {} -#endif template ::value>> @@ -3023,8 +2972,6 @@ class __SYCL_EBO host_accessor const detail::code_location CodeLoc = detail::code_location::current()) : AccessorT(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {} -#if __cplusplus >= 201703L - template ::value>> host_accessor( @@ -3034,8 +2981,6 @@ class __SYCL_EBO host_accessor const detail::code_location CodeLoc = detail::code_location::current()) : host_accessor(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {} -#endif - template ::value>> host_accessor( @@ -3044,8 +2989,6 @@ class __SYCL_EBO host_accessor const detail::code_location CodeLoc = detail::code_location::current()) : AccessorT(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {} -#if __cplusplus >= 201703L - template ::value>> host_accessor( @@ -3055,8 +2998,6 @@ class __SYCL_EBO host_accessor const detail::code_location CodeLoc = detail::code_location::current()) : host_accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {} -#endif - template ::value>> host_accessor( @@ -3067,8 +3008,6 @@ class __SYCL_EBO host_accessor : AccessorT(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList, CodeLoc) {} -#if __cplusplus >= 201703L - template ::value>> host_accessor( @@ -3079,8 +3018,6 @@ class __SYCL_EBO host_accessor : host_accessor(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList, CodeLoc) {} -#endif - template ::value>> host_accessor( @@ -3091,8 +3028,6 @@ class __SYCL_EBO host_accessor : AccessorT(BufferRef, AccessRange, AccessOffset, PropertyList, CodeLoc) { } -#if __cplusplus >= 201703L - template ::value>> host_accessor( @@ -3103,8 +3038,6 @@ class __SYCL_EBO host_accessor : host_accessor(BufferRef, AccessRange, AccessOffset, PropertyList, CodeLoc) {} -#endif - template ::value>> host_accessor( @@ -3115,8 +3048,6 @@ class __SYCL_EBO host_accessor : AccessorT(BufferRef, CommandGroupHandler, AccessRange, AccessOffset, PropertyList, CodeLoc) {} -#if __cplusplus >= 201703L - template ::value>> host_accessor( @@ -3127,12 +3058,8 @@ class __SYCL_EBO host_accessor const detail::code_location CodeLoc = detail::code_location::current()) : host_accessor(BufferRef, CommandGroupHandler, AccessRange, AccessOffset, PropertyList, CodeLoc) {} - -#endif }; -#if __cplusplus >= 201703L - template host_accessor(buffer) -> host_accessor; @@ -3165,9 +3092,6 @@ template , Type1, Type2, Type3, Type4, Type5) -> host_accessor()>; - -#endif - } // __SYCL_INLINE_VER_NAMESPACE(_V1) } // namespace sycl diff --git a/sycl/include/sycl/buffer.hpp b/sycl/include/sycl/buffer.hpp index 5e115c4f3643a..50dfe79f0b984 100644 --- a/sycl/include/sycl/buffer.hpp +++ b/sycl/include/sycl/buffer.hpp @@ -547,8 +547,6 @@ class buffer : public detail::buffer_plain, *this, accessRange, accessOffset, {}, CodeLoc); } -#if __cplusplus >= 201703L - template auto get_access(Ts... args) { return accessor{*this, args...}; } @@ -567,8 +565,6 @@ class buffer : public detail::buffer_plain, return host_accessor{*this, commandGroupHandler, args...}; } -#endif - template void set_final_data(Destination finalData = nullptr) { this->set_final_data_internal(finalData); diff --git a/sycl/include/sycl/detail/defines_elementary.hpp b/sycl/include/sycl/detail/defines_elementary.hpp index 6387ea02f95a8..19abc9e1af049 100644 --- a/sycl/include/sycl/detail/defines_elementary.hpp +++ b/sycl/include/sycl/detail/defines_elementary.hpp @@ -37,9 +37,7 @@ #endif #ifndef __SYCL_DEPRECATED -// The deprecated attribute is not supported in some situations(e.g. namespace) -// in C++14 mode -#if !defined(SYCL2020_DISABLE_DEPRECATION_WARNINGS) && __cplusplus >= 201703L +#if !defined(SYCL2020_DISABLE_DEPRECATION_WARNINGS) #define __SYCL_DEPRECATED(message) [[deprecated(message)]] #else // SYCL_DISABLE_DEPRECATION_WARNINGS #define __SYCL_DEPRECATED(message) diff --git a/sycl/include/sycl/detail/generic_type_lists.hpp b/sycl/include/sycl/detail/generic_type_lists.hpp index 558dddf4963ca..9dd6fb41fad62 100644 --- a/sycl/include/sycl/detail/generic_type_lists.hpp +++ b/sycl/include/sycl/detail/generic_type_lists.hpp @@ -411,7 +411,7 @@ using long_integer_list = type_list; -#if __cplusplus >= 201703L && (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE != 0) +#if (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE != 0) // std::byte using scalar_byte_list = type_list; @@ -457,7 +457,7 @@ using scalar_unsigned_integer_list = scalar_unsigned_char_list>, scalar_unsigned_short_list, scalar_unsigned_int_list, scalar_unsigned_long_list, scalar_unsigned_longlong_list -#if __cplusplus >= 201703L && (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE != 0) +#if (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE != 0) , scalar_byte_list #endif @@ -470,7 +470,7 @@ using vector_unsigned_integer_list = vector_unsigned_char_list>, vector_unsigned_short_list, vector_unsigned_int_list, vector_unsigned_long_list, vector_unsigned_longlong_list -#if __cplusplus >= 201703L && (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE != 0) +#if (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE != 0) , vector_byte_list #endif @@ -483,7 +483,7 @@ using marray_unsigned_integer_list = marray_unsigned_char_list>, marray_unsigned_short_list, marray_unsigned_int_list, marray_unsigned_long_list, marray_unsigned_longlong_list -#if __cplusplus >= 201703L && (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE != 0) +#if (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE != 0) , marray_byte_list #endif diff --git a/sycl/include/sycl/detail/generic_type_traits.hpp b/sycl/include/sycl/detail/generic_type_traits.hpp index 0e0fae60049ab..4114f55c53300 100644 --- a/sycl/include/sycl/detail/generic_type_traits.hpp +++ b/sycl/include/sycl/detail/generic_type_traits.hpp @@ -515,7 +515,7 @@ template struct TypeHelper { using RetType = T; }; -#if __cplusplus >= 201703L && (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE != 0) +#if (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE != 0) template <> struct TypeHelper { using RetType = std::uint8_t; }; diff --git a/sycl/include/sycl/detail/kernel_desc.hpp b/sycl/include/sycl/detail/kernel_desc.hpp index e5f7580407684..9f7c4db7dac55 100644 --- a/sycl/include/sycl/detail/kernel_desc.hpp +++ b/sycl/include/sycl/detail/kernel_desc.hpp @@ -63,10 +63,6 @@ template struct SpecConstantInfo { static constexpr const char *getName() { return ""; } }; -// This guard is needed because the libsycl.so can be compiled with C++ <=14 -// while the code requires C++17. This code is not supposed to be used by the -// libsycl.so so it should not be a problem. -#if __cplusplus >= 201703L // Translates SYCL 2020 `specialization_id` to a unique symbolic identifier. // There are no primary definition, only specializations in the integration // footer. @@ -76,7 +72,6 @@ template const char *get_spec_constant_symbolic_ID_impl(); // specializations for it generated by the compiler in the integration footer. // Definition in spec_const_integration.hpp. template const char *get_spec_constant_symbolic_ID(); -#endif #ifndef __SYCL_UNNAMED_LAMBDA__ template struct KernelInfo { diff --git a/sycl/include/sycl/detail/spec_const_integration.hpp b/sycl/include/sycl/detail/spec_const_integration.hpp index e582c220f89e5..e375dc05c2127 100644 --- a/sycl/include/sycl/detail/spec_const_integration.hpp +++ b/sycl/include/sycl/detail/spec_const_integration.hpp @@ -14,15 +14,11 @@ namespace sycl { __SYCL_INLINE_VER_NAMESPACE(_V1) { namespace detail { - -#if __cplusplus >= 201703L // Translates SYCL 2020 `specialization_id` to a unique symbolic identifier // which is used internally by the toolchain template const char *get_spec_constant_symbolic_ID() { return get_spec_constant_symbolic_ID_impl(); } -#endif - } // namespace detail } // __SYCL_INLINE_VER_NAMESPACE(_V1) } // namespace sycl diff --git a/sycl/include/sycl/device.hpp b/sycl/include/sycl/device.hpp index ce61887b635d8..df523ac6f9f5f 100644 --- a/sycl/include/sycl/device.hpp +++ b/sycl/include/sycl/device.hpp @@ -67,7 +67,6 @@ class __SYCL_EXPORT device : public detail::OwnerLessBase { "use SYCL 2020 device selectors instead.") explicit device(const device_selector &DeviceSelector); -#if __cplusplus >= 201703L /// Constructs a SYCL device instance using the device /// identified by the device selector provided. /// \param DeviceSelector is SYCL 2020 Device Selector, a simple callable that @@ -77,7 +76,6 @@ class __SYCL_EXPORT device : public detail::OwnerLessBase { detail::EnableIfSYCL2020DeviceSelectorInvocable> explicit device(const DeviceSelector &deviceSelector) : device(detail::select_device(deviceSelector)) {} -#endif bool operator==(const device &rhs) const { return impl == rhs.impl; } diff --git a/sycl/include/sycl/device_selector.hpp b/sycl/include/sycl/device_selector.hpp index 3bed1a5cc103a..3a890bf5d0ef4 100644 --- a/sycl/include/sycl/device_selector.hpp +++ b/sycl/include/sycl/device_selector.hpp @@ -130,8 +130,6 @@ void fill_aspect_vector(std::vector &V, FirstT F, OtherTs... O) { fill_aspect_vector(V, O...); } -#if __cplusplus >= 201703L - // Enable if DeviceSelector callable has matching signature, but // exclude if descended from filter_selector which is not purely callable or // if descended from it is descended from SYCL 1.2.1 device_selector. @@ -141,7 +139,6 @@ using EnableIfSYCL2020DeviceSelectorInvocable = std::enable_if_t< std::is_invocable_r_v && !std::is_base_of_v && !std::is_base_of_v>; -#endif __SYCL_EXPORT device select_device(const DSelectorInvocableType &DeviceSelectorInvocable); diff --git a/sycl/include/sycl/ext/intel/math.hpp b/sycl/include/sycl/ext/intel/math.hpp index 6a394beb94d7f..e58e41f86b4ac 100644 --- a/sycl/include/sycl/ext/intel/math.hpp +++ b/sycl/include/sycl/ext/intel/math.hpp @@ -53,8 +53,6 @@ namespace ext { namespace intel { namespace math { -#if __cplusplus >= 201703L - static_assert(sizeof(sycl::half) == sizeof(_iml_half_internal), "sycl::half is not compatible with _iml_half_internal."); @@ -200,8 +198,6 @@ std::enable_if_t, sycl::half> trunc(Tp x) { sycl::half2 trunc(sycl::half2 x) { return sycl::half2{trunc(x.s0()), trunc(x.s1())}; } - -#endif } // namespace math } // namespace intel } // namespace ext diff --git a/sycl/include/sycl/ext/oneapi/accessor_property_list.hpp b/sycl/include/sycl/ext/oneapi/accessor_property_list.hpp index c20659cb7ef92..97b89a13c36f5 100644 --- a/sycl/include/sycl/ext/oneapi/accessor_property_list.hpp +++ b/sycl/include/sycl/ext/oneapi/accessor_property_list.hpp @@ -48,13 +48,13 @@ class __SYCL_TYPE(accessor_property_list) accessor_property_list template struct AreSameTemplate : std::is_same {}; template