From 3dbab10d62c8666a3cf8627f875a6ec3d701c300 Mon Sep 17 00:00:00 2001 From: Artem Gindinson Date: Fri, 13 Nov 2020 15:49:53 +0300 Subject: [PATCH 1/3] [SYCL][NFC] Employ the is_same_v helper in SYCL library Similarly to [intel/llvm@b469f03], refactor the usages of the `is_same` type trait to reduce code verbosity. This particular trait was chosen because of its popularity, and will probably be the last in this refactoring series. Signed-off-by: Artem Gindinson --- .../sycl/INTEL/esimd/detail/esimd_intrin.hpp | 2 +- .../sycl/INTEL/esimd/detail/esimd_types.hpp | 7 +- .../CL/sycl/INTEL/esimd/detail/esimd_util.hpp | 54 ++++---- sycl/include/CL/sycl/INTEL/esimd/esimd.hpp | 2 +- .../CL/sycl/INTEL/esimd/esimd_math.hpp | 16 +-- .../CL/sycl/ONEAPI/accessor_property_list.hpp | 2 +- sycl/include/CL/sycl/ONEAPI/atomic_ref.hpp | 12 +- .../CL/sycl/ONEAPI/group_algorithm.hpp | 128 +++++++++--------- sycl/include/CL/sycl/ONEAPI/reduction.hpp | 108 +++++++-------- sycl/include/CL/sycl/ONEAPI/sub_group.hpp | 4 +- sycl/include/CL/sycl/accessor.hpp | 35 +++-- sycl/include/CL/sycl/atomic.hpp | 15 +- sycl/include/CL/sycl/backend/level_zero.hpp | 12 +- sycl/include/CL/sycl/backend/opencl.hpp | 14 +- sycl/include/CL/sycl/buffer.hpp | 2 +- sycl/include/CL/sycl/detail/accessor_impl.hpp | 42 +++--- sycl/include/CL/sycl/detail/cg_types.hpp | 12 +- .../CL/sycl/detail/generic_type_traits.hpp | 10 +- .../CL/sycl/detail/stl_type_traits.hpp | 3 + .../CL/sycl/detail/sycl_mem_obj_allocator.hpp | 4 +- .../include/CL/sycl/detail/sycl_mem_obj_t.hpp | 4 +- sycl/include/CL/sycl/detail/type_list.hpp | 7 +- sycl/include/CL/sycl/detail/type_traits.hpp | 6 +- sycl/include/CL/sycl/handler.hpp | 21 +-- sycl/include/CL/sycl/multi_ptr.hpp | 33 +++-- sycl/include/CL/sycl/stream.hpp | 10 +- sycl/include/CL/sycl/types.hpp | 113 ++++++++-------- .../source/detail/scheduler/graph_builder.cpp | 2 +- sycl/source/detail/scheduler/scheduler.hpp | 2 +- 29 files changed, 338 insertions(+), 344 deletions(-) diff --git a/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_intrin.hpp b/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_intrin.hpp index 34bbc905ceb44..111fd37c3e024 100644 --- a/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_intrin.hpp +++ b/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_intrin.hpp @@ -179,7 +179,7 @@ readRegion(const vector_type_t &Base, std::pair Region) { return readRegion(Base1, Region.first); else { static_assert(T::Is_2D); - static_assert(std::is_same::value); + static_assert(sycl::detail::is_same_v); // To read a 2D region, we need the parent region // Read full rows with non-trivial vertical and horizontal stride = 1. constexpr int M = T::Size_y * PaTy::Size_x; diff --git a/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_types.hpp b/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_types.hpp index 1655c78c96352..aae6535aff487 100644 --- a/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_types.hpp +++ b/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_types.hpp @@ -209,7 +209,7 @@ template constexpr bool is_type() { return false; } template constexpr bool is_type() { using UU = typename detail::remove_const_t; using TT = typename detail::remove_const_t; - return std::is_same::value || is_type(); + return sycl::detail::is_same_v || is_type(); } // calculates the number of elements in "To" type @@ -228,12 +228,13 @@ struct bitcast_helper { template ::value>> ESIMD_INLINE typename detail::conditional_t< - std::is_same::value, vector_type_t, + sycl::detail::is_same_v, + vector_type_t, vector_type_t::nToElems()>> bitcast(vector_type_t Val) { // Noop. - if constexpr (std::is_same::value) + if constexpr (sycl::detail::is_same_v) return Val; // Bitcast diff --git a/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_util.hpp b/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_util.hpp index 6d0be7f5521ff..5bd1c5db2d62b 100755 --- a/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_util.hpp +++ b/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_util.hpp @@ -101,9 +101,10 @@ template struct is_dword_type : std::integral_constant< bool, - std::is_same>::value || - std::is_same>::value> {}; + sycl::detail::is_same_v> || + sycl::detail::is_same_v< + unsigned int, typename sycl::detail::remove_const_t>> {}; template struct is_dword_type> { @@ -119,10 +120,10 @@ template struct is_word_type : std::integral_constant< bool, - std::is_same>::value || - std::is_same>::value> {}; + sycl::detail::is_same_v> || + sycl::detail::is_same_v< + unsigned short, typename sycl::detail::remove_const_t>> {}; template struct is_word_type> { @@ -137,9 +138,10 @@ template struct is_byte_type : std::integral_constant< bool, - std::is_same>::value || - std::is_same>::value> {}; + sycl::detail::is_same_v> || + sycl::detail::is_same_v< + unsigned char, typename sycl::detail::remove_const_t>> {}; template struct is_byte_type> { @@ -153,36 +155,34 @@ template struct is_byte_type> { template struct is_fp_type : std::integral_constant< - bool, std::is_same>::value> { -}; + bool, sycl::detail::is_same_v< + float, typename sycl::detail::remove_const_t>> {}; template struct is_df_type : std::integral_constant< - bool, std::is_same>::value> { -}; + bool, sycl::detail::is_same_v< + double, typename sycl::detail::remove_const_t>> {}; template struct is_fp_or_dword_type : std::integral_constant< bool, - std::is_same>::value || - std::is_same>::value || - std::is_same>::value> {}; + sycl::detail::is_same_v> || + sycl::detail::is_same_v< + int, typename sycl::detail::remove_const_t> || + sycl::detail::is_same_v< + unsigned int, typename sycl::detail::remove_const_t>> {}; template struct is_qword_type : std::integral_constant< - bool, - std::is_same>::value || - std::is_same>::value> {}; + bool, sycl::detail::is_same_v< + long long, typename sycl::detail::remove_const_t> || + sycl::detail::is_same_v< + unsigned long long, + typename sycl::detail::remove_const_t>> {}; template struct is_qword_type> { diff --git a/sycl/include/CL/sycl/INTEL/esimd/esimd.hpp b/sycl/include/CL/sycl/INTEL/esimd/esimd.hpp index 6a9251cbc33b6..b3437c7c9dcf6 100644 --- a/sycl/include/CL/sycl/INTEL/esimd/esimd.hpp +++ b/sycl/include/CL/sycl/INTEL/esimd/esimd.hpp @@ -403,7 +403,7 @@ template class simd { Base1 = __esimd_wrregion(Base1, Val, Offset); } else { - static_assert(std::is_same::value); + static_assert(sycl::detail::is_same_v); // Read columns with non-trivial horizontal stride. constexpr int M = TR::length; constexpr int VS = PaTy::Size_x * TR::Stride_y; diff --git a/sycl/include/CL/sycl/INTEL/esimd/esimd_math.hpp b/sycl/include/CL/sycl/INTEL/esimd/esimd_math.hpp index bda406c12beb9..dc1bf201ac3d9 100644 --- a/sycl/include/CL/sycl/INTEL/esimd/esimd_math.hpp +++ b/sycl/include/CL/sycl/INTEL/esimd/esimd_math.hpp @@ -73,8 +73,8 @@ __esimd_abs_common_internal(T1 src0, int flag = GENX_NOSAT) { template ESIMD_NODEBUG ESIMD_INLINE typename sycl::detail::enable_if_t< - !std::is_same, - typename sycl::detail::remove_const_t>::value, + !sycl::detail::is_same_v, + typename sycl::detail::remove_const_t>, simd> esimd_abs(simd src0, int flag = GENX_NOSAT) { return detail::__esimd_abs_common_internal(src0, flag); @@ -82,8 +82,8 @@ esimd_abs(simd src0, int flag = GENX_NOSAT) { template ESIMD_NODEBUG ESIMD_INLINE typename sycl::detail::enable_if_t< - !std::is_same, - typename sycl::detail::remove_const_t>::value && + !sycl::detail::is_same_v, + typename sycl::detail::remove_const_t> && detail::is_esimd_scalar::value && detail::is_esimd_scalar::value, typename sycl::detail::remove_const_t> @@ -1905,12 +1905,12 @@ ESIMD_INLINE ESIMD_NODEBUG T0 hmin(simd v) { template ESIMD_INLINE ESIMD_NODEBUG T0 reduce(simd v, BinaryOperation op) { - if constexpr (std::is_same, - std::plus<>>::value) { + if constexpr (sycl::detail::is_same_v, + std::plus<>>) { T0 retv = detail::esimd_sum(v); return retv; - } else if constexpr (std::is_same, - std::multiplies<>>::value) { + } else if constexpr (sycl::detail::is_same_v, + std::multiplies<>>) { T0 retv = detail::esimd_prod(v); return retv; } diff --git a/sycl/include/CL/sycl/ONEAPI/accessor_property_list.hpp b/sycl/include/CL/sycl/ONEAPI/accessor_property_list.hpp index b83e4ed43d316..c0a72f6b9a440 100644 --- a/sycl/include/CL/sycl/ONEAPI/accessor_property_list.hpp +++ b/sycl/include/CL/sycl/ONEAPI/accessor_property_list.hpp @@ -86,7 +86,7 @@ class accessor_property_list : protected sycl::detail::PropertyListBase { auto... Args> struct ContainsPropertyInstance : detail::conditional_t< - !std::is_same_v && + !detail::is_same_v && AreSameTemplate, typename ContainerT::Head>::value, std::true_type, diff --git a/sycl/include/CL/sycl/ONEAPI/atomic_ref.hpp b/sycl/include/CL/sycl/ONEAPI/atomic_ref.hpp index c98c4f55857b8..e3a5f504c46d1 100644 --- a/sycl/include/CL/sycl/ONEAPI/atomic_ref.hpp +++ b/sycl/include/CL/sycl/ONEAPI/atomic_ref.hpp @@ -126,14 +126,14 @@ class atomic_ref_base { static_assert( detail::IsValidAtomicType::value, "Invalid atomic type. Valid types are arithmetic and pointer types"); - static_assert(!std::is_same::value, + static_assert(!detail::is_same_v, "ONEAPI::atomic_ref does not support bool type"); - static_assert(!(std::is_same::value || - std::is_same::value || - std::is_same::value), + static_assert(!(detail::is_same_v || + detail::is_same_v || + detail::is_same_v), "ONEAPI::atomic_ref does not support char type"); - static_assert(!(std::is_same::value || - std::is_same::value), + static_assert(!(detail::is_same_v || + detail::is_same_v), "ONEAPI::atomic_ref does not support short type"); static_assert(detail::IsValidAtomicAddressSpace::value, "Invalid atomic address_space. Valid address spaces are: " diff --git a/sycl/include/CL/sycl/ONEAPI/group_algorithm.hpp b/sycl/include/CL/sycl/ONEAPI/group_algorithm.hpp index 3aaab50b236aa..1b0c7ad38e7a7 100644 --- a/sycl/include/CL/sycl/ONEAPI/group_algorithm.hpp +++ b/sycl/include/CL/sycl/ONEAPI/group_algorithm.hpp @@ -421,9 +421,9 @@ detail::enable_if_t<(detail::is_generic_group::value && reduce(Group, T x, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), + detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match reduction accumulation type."); #ifdef __SYCL_DEVICE_ONLY__ return sycl::detail::calc::value && reduce(Group g, T x, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), + detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match reduction accumulation type."); T result; for (int s = 0; s < x.get_size(); ++s) { @@ -482,9 +482,9 @@ detail::enable_if_t<(detail::is_generic_group::value && reduce(Group g, V x, T init, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), + detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match reduction accumulation type."); #ifdef __SYCL_DEVICE_ONLY__ return binary_op(init, reduce(g, x, binary_op)); @@ -505,10 +505,10 @@ detail::enable_if_t<(detail::is_generic_group::value && reduce(Group g, V x, T init, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), + detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match reduction accumulation type."); #ifdef __SYCL_DEVICE_ONLY__ T result = init; @@ -551,9 +551,9 @@ reduce(Group g, Ptr first, Ptr last, BinaryOperation binary_op) { using T = typename detail::remove_pointer::type; // FIXME: Do not special-case for half precision static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), + detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match reduction accumulation type."); #ifdef __SYCL_DEVICE_ONLY__ typename Ptr::element_type partial = @@ -582,9 +582,9 @@ detail::enable_if_t< reduce(Group g, Ptr first, Ptr last, T init, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), + detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match reduction accumulation type."); #ifdef __SYCL_DEVICE_ONLY__ T partial = sycl::detail::identity::value; @@ -608,9 +608,9 @@ detail::enable_if_t<(detail::is_generic_group::value && T> exclusive_scan(Group, T x, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision - static_assert(std::is_same::value || - (std::is_same::value && - std::is_same::value), + static_assert(detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match scan accumulation type."); #ifdef __SYCL_DEVICE_ONLY__ return sycl::detail::calc::value && T> exclusive_scan(Group g, T x, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision - static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), - "Result type of binary_op must match scan accumulation type."); + static_assert(detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), + "Result type of binary_op must match scan accumulation type."); T result; for (int s = 0; s < x.get_size(); ++s) { result[s] = exclusive_scan(g, x[s], binary_op); @@ -652,10 +651,10 @@ detail::enable_if_t<(detail::is_generic_group::value && exclusive_scan(Group g, V x, T init, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), + detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match scan accumulation type."); T result; for (int s = 0; s < x.get_size(); ++s) { @@ -673,9 +672,9 @@ detail::enable_if_t<(detail::is_generic_group::value && T> exclusive_scan(Group g, V x, T init, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision - static_assert(std::is_same::value || - (std::is_same::value && - std::is_same::value), + static_assert(detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match scan accumulation type."); #ifdef __SYCL_DEVICE_ONLY__ typename Group::linear_id_type local_linear_id = @@ -711,9 +710,9 @@ exclusive_scan(Group g, InPtr first, InPtr last, OutPtr result, T init, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), + detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match scan accumulation type."); #ifdef __SYCL_DEVICE_ONLY__ ptrdiff_t offset = sycl::detail::get_local_linear_id(g); @@ -761,10 +760,10 @@ exclusive_scan(Group g, InPtr first, InPtr last, OutPtr result, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), + detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match scan accumulation type."); return exclusive_scan(g, first, last, result, sycl::detail::identity::value && T> inclusive_scan(Group g, T x, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision - static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), - "Result type of binary_op must match scan accumulation type."); + static_assert(detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), + "Result type of binary_op must match scan accumulation type."); T result; for (int s = 0; s < x.get_size(); ++s) { result[s] = inclusive_scan(g, x[s], binary_op); @@ -799,9 +797,9 @@ detail::enable_if_t<(detail::is_generic_group::value && T> inclusive_scan(Group, T x, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision - static_assert(std::is_same::value || - (std::is_same::value && - std::is_same::value), + static_assert(detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match scan accumulation type."); #ifdef __SYCL_DEVICE_ONLY__ return sycl::detail::calc::value && T> inclusive_scan(Group g, V x, BinaryOperation binary_op, T init) { // FIXME: Do not special-case for half precision - static_assert(std::is_same::value || - (std::is_same::value && - std::is_same::value), + static_assert(detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match scan accumulation type."); #ifdef __SYCL_DEVICE_ONLY__ if (sycl::detail::get_local_linear_id(g) == 0) { @@ -848,9 +846,9 @@ detail::enable_if_t<(detail::is_generic_group::value && inclusive_scan(Group g, V x, BinaryOperation binary_op, T init) { // FIXME: Do not special-case for half precision static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), + detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match scan accumulation type."); T result; for (int s = 0; s < x.get_size(); ++s) { @@ -875,9 +873,9 @@ inclusive_scan(Group g, InPtr first, InPtr last, OutPtr result, BinaryOperation binary_op, T init) { // FIXME: Do not special-case for half precision static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), + detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match scan accumulation type."); #ifdef __SYCL_DEVICE_ONLY__ ptrdiff_t offset = sycl::detail::get_local_linear_id(g); @@ -924,10 +922,10 @@ inclusive_scan(Group g, InPtr first, InPtr last, OutPtr result, BinaryOperation binary_op) { // FIXME: Do not special-case for half precision static_assert( - std::is_same::value || - (std::is_same::value && - std::is_same::value), + detail::is_same_v || + (detail::is_same_v && + detail::is_same_v), "Result type of binary_op must match scan accumulation type."); return inclusive_scan(g, first, last, result, binary_op, sycl::detail::identity using IsReduPlus = detail::bool_constant< - std::is_same>::value || - std::is_same>::value>; + detail::is_same_v> || + detail::is_same_v>>; template using IsReduMultiplies = detail::bool_constant< - std::is_same>::value || - std::is_same>::value>; + detail::is_same_v> || + detail::is_same_v>>; template using IsReduMinimum = detail::bool_constant< - std::is_same>::value || - std::is_same>::value>; + detail::is_same_v> || + detail::is_same_v>>; template using IsReduMaximum = detail::bool_constant< - std::is_same>::value || - std::is_same>::value>; + detail::is_same_v> || + detail::is_same_v>>; template using IsReduBitOR = detail::bool_constant< - std::is_same>::value || - std::is_same>::value>; + detail::is_same_v> || + detail::is_same_v>>; template using IsReduBitXOR = detail::bool_constant< - std::is_same>::value || - std::is_same>::value>; + detail::is_same_v> || + detail::is_same_v>>; template using IsReduBitAND = detail::bool_constant< - std::is_same>::value || - std::is_same>::value>; + detail::is_same_v> || + detail::is_same_v>>; template using IsReduOptForFastAtomicFetch = @@ -81,13 +81,12 @@ using IsReduOptForFastAtomicFetch = IsReduBitAND::value)>; template -using IsReduOptForFastReduce = detail::bool_constant< - (is_geninteger32bit::value || is_geninteger64bit::value || - std::is_same::value || std::is_same::value || - std::is_same::value) && - (IsReduPlus::value || - IsReduMinimum::value || - IsReduMaximum::value)>; +using IsReduOptForFastReduce = detail::bool_constant<( + is_geninteger32bit::value || is_geninteger64bit::value || + detail::is_same_v || detail::is_same_v || + detail::is_same_v) && (IsReduPlus::value || + IsReduMinimum::value || + IsReduMaximum::value)>; // Identity = 0 template @@ -97,18 +96,16 @@ using IsZeroIdentityOp = bool_constant< (IsReduPlus::value || IsReduBitOR::value || IsReduBitXOR::value)) || - ((std::is_same::value || std::is_same::value || - std::is_same::value) && - IsReduPlus::value)>; + ((detail::is_same_v || detail::is_same_v || + detail::is_same_v) && IsReduPlus::value)>; // Identity = 1 template -using IsOneIdentityOp = bool_constant< - (is_geninteger8bit::value || is_geninteger16bit::value || - is_geninteger32bit::value || is_geninteger64bit::value || - std::is_same::value || std::is_same::value || - std::is_same::value) && - IsReduMultiplies::value>; +using IsOneIdentityOp = bool_constant<( + is_geninteger8bit::value || is_geninteger16bit::value || + is_geninteger32bit::value || is_geninteger64bit::value || + detail::is_same_v || detail::is_same_v || + detail::is_same_v) && IsReduMultiplies::value>; // Identity = ~0 template @@ -119,21 +116,19 @@ using IsOnesIdentityOp = bool_constant< // Identity = template -using IsMinimumIdentityOp = bool_constant< - (is_geninteger8bit::value || is_geninteger16bit::value || - is_geninteger32bit::value || is_geninteger64bit::value || - std::is_same::value || std::is_same::value || - std::is_same::value) && - IsReduMinimum::value>; +using IsMinimumIdentityOp = bool_constant<( + is_geninteger8bit::value || is_geninteger16bit::value || + is_geninteger32bit::value || is_geninteger64bit::value || + detail::is_same_v || detail::is_same_v || + detail::is_same_v)&&IsReduMinimum::value>; // Identity = template -using IsMaximumIdentityOp = bool_constant< - (is_geninteger8bit::value || is_geninteger16bit::value || - is_geninteger32bit::value || is_geninteger64bit::value || - std::is_same::value || std::is_same::value || - std::is_same::value) && - IsReduMaximum::value>; +using IsMaximumIdentityOp = bool_constant<( + is_geninteger8bit::value || is_geninteger16bit::value || + is_geninteger32bit::value || is_geninteger64bit::value || + detail::is_same_v || detail::is_same_v || + detail::is_same_v) && IsReduMaximum::value>; template using IsKnownIdentityOp = @@ -232,8 +227,7 @@ class reducer - enable_if_t::value && - IsReduPlus::value, + enable_if_t && IsReduPlus::value, reducer &> operator+=(const _T &Partial) { combine(Partial); @@ -241,7 +235,7 @@ class reducer - enable_if_t::value && + enable_if_t && IsReduMultiplies::value, reducer &> operator*=(const _T &Partial) { @@ -250,7 +244,7 @@ class reducer - enable_if_t::value && + enable_if_t && IsReduBitOR::value, reducer &> operator|=(const _T &Partial) { @@ -259,7 +253,7 @@ class reducer - enable_if_t::value && + enable_if_t && IsReduBitXOR::value, reducer &> operator^=(const _T &Partial) { @@ -268,7 +262,7 @@ class reducer - enable_if_t::value && + enable_if_t && IsReduBitAND::value, reducer &> operator&=(const _T &Partial) { @@ -278,7 +272,7 @@ class reducer - enable_if_t::type, T>::value && + enable_if_t::type, T> && (is_geninteger32bit::value || is_geninteger64bit::value) && IsReduPlus::value> atomic_combine(_T *ReduVarPtr) const { @@ -288,7 +282,7 @@ class reducer - enable_if_t::type, T>::value && + enable_if_t::type, T> && (is_geninteger32bit::value || is_geninteger64bit::value) && IsReduBitOR::value> atomic_combine(_T *ReduVarPtr) const { @@ -298,7 +292,7 @@ class reducer - enable_if_t::type, T>::value && + enable_if_t::type, T> && (is_geninteger32bit::value || is_geninteger64bit::value) && IsReduBitXOR::value> atomic_combine(_T *ReduVarPtr) const { @@ -308,7 +302,7 @@ class reducer - enable_if_t::type, T>::value && + enable_if_t::type, T> && (is_geninteger32bit::value || is_geninteger64bit::value) && IsReduBitAND::value> atomic_combine(_T *ReduVarPtr) const { @@ -318,7 +312,7 @@ class reducer - enable_if_t::type, T>::value && + enable_if_t::type, T> && (is_geninteger32bit::value || is_geninteger64bit::value) && IsReduMinimum::value> atomic_combine(_T *ReduVarPtr) const { @@ -328,7 +322,7 @@ class reducer - enable_if_t::type, T>::value && + enable_if_t::type, T> && (is_geninteger32bit::value || is_geninteger64bit::value) && IsReduMaximum::value> atomic_combine(_T *ReduVarPtr) const { @@ -554,14 +548,14 @@ class reduction_impl { } template - enable_if_t::value || - std::is_same::value, + enable_if_t || + detail::is_same_v, result_type *> static inline getOutPointer(const AccT &OutAcc) { return OutAcc.get_pointer().get(); } template - enable_if_t::value, + enable_if_t, result_type *> static inline getOutPointer(ResT *OutPtr) { return OutPtr; } diff --git a/sycl/include/CL/sycl/ONEAPI/sub_group.hpp b/sycl/include/CL/sycl/ONEAPI/sub_group.hpp index 981ec3acf779a..e9183369077b9 100644 --- a/sycl/include/CL/sycl/ONEAPI/sub_group.hpp +++ b/sycl/include/CL/sycl/ONEAPI/sub_group.hpp @@ -37,12 +37,12 @@ using SelectBlockT = select_cl_scalar_integral_unsigned_t; template using AcceptableForGlobalLoadStore = - bool_constant>::value && + bool_constant> && Space == access::address_space::global_space>; template using AcceptableForLocalLoadStore = - bool_constant>::value && + bool_constant> && Space == access::address_space::local_space>; #ifdef __SYCL_DEVICE_ONLY__ diff --git a/sycl/include/CL/sycl/accessor.hpp b/sycl/include/CL/sycl/accessor.hpp index 7f8e62409b661..7ed32b07a64f0 100755 --- a/sycl/include/CL/sycl/accessor.hpp +++ b/sycl/include/CL/sycl/accessor.hpp @@ -402,12 +402,12 @@ class image_accessor constexpr static bool IsImageAccessAnyRead = (IsImageAccessReadOnly || AccessMode == access::mode::read_write); - static_assert(std::is_same::value || - std::is_same::value || - std::is_same::value || - std::is_same::value, - "The data type of an image accessor must be only cl_int4, " - "cl_uint4, cl_float4 or cl_half4 from SYCL namespace"); + static_assert(detail::is_same_v || + detail::is_same_v || + detail::is_same_v || + detail::is_same_v, + "The data type of an image accessor must be only cl_int4, " + "cl_uint4, cl_float4 or cl_half4 from SYCL namespace"); static_assert(IsImageAcc || IsHostImageAcc || IsImageArrayAcc, "Expected image type"); @@ -672,7 +672,7 @@ class __image_array_slice__ { getAdjustedCoords(const CoordT &Coords) const { CoordElemType LastCoord = 0; - if (std::is_same::value) { + if (detail::is_same_v) { sycl::vec Size = MBaseAcc.getRangeInternal(); LastCoord = MIdx / static_cast(Size.template swizzle()); @@ -819,7 +819,7 @@ class accessor : } template static constexpr bool IsSameAsBuffer() { - return std::is_same::value && (Dims > 0) && (Dims == Dimensions); + return detail::is_same_v && (Dims > 0) && (Dims == Dimensions); } static access::mode getAdjustedMode(const PropertyListT &PropertyList) { @@ -839,9 +839,8 @@ class accessor : #if __cplusplus > 201402L template static constexpr bool IsValidTag() { - return std::is_same>::value || - std::is_same>::value; + return detail::is_same_v> || + detail::is_same_v>; } #endif @@ -959,7 +958,7 @@ class accessor : template ::value && - std::is_same::value && Dims == 0 && + detail::is_same_v && Dims == 0 && ((!IsPlaceH && IsHostBuf) || (IsPlaceH && (IsGlobalBuf || IsConstantBuf)))> * = nullptr> accessor(buffer &BufferRef, @@ -984,7 +983,7 @@ class accessor : typename... PropTypes, typename detail::enable_if_t< detail::IsCxPropertyList::value && - std::is_same::value && Dims == 0 && + detail::is_same_v && Dims == 0 && ((!IsPlaceH && IsHostBuf) || (IsPlaceH && (IsGlobalBuf || IsConstantBuf)))> * = nullptr> accessor( @@ -1009,7 +1008,7 @@ class accessor : template ::value && - std::is_same::value && (Dims == 0) && + detail::is_same_v && (Dims == 0) && (!IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf))>> accessor(buffer &BufferRef, handler &CommandGroupHandler, const property_list &PropertyList = {}) @@ -1034,7 +1033,7 @@ class accessor : typename... PropTypes, typename = typename detail::enable_if_t< detail::IsCxPropertyList::value && - std::is_same::value && (Dims == 0) && + detail::is_same_v && (Dims == 0) && (!IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf))>> accessor( buffer &BufferRef, handler &CommandGroupHandler, @@ -2051,13 +2050,13 @@ class host_accessor constexpr static int AdjustedDim = Dimensions == 0 ? 1 : Dimensions; template static constexpr bool IsSameAsBuffer() { - return std::is_same::value && (Dims > 0) && (Dims == Dimensions); + return detail::is_same_v && (Dims > 0) && (Dims == Dimensions); } #if __cplusplus > 201402L template static constexpr bool IsValidTag() { - return std::is_same>::value; + return detail::is_same_v>; } #endif @@ -2098,7 +2097,7 @@ class host_accessor template ::value && Dims == 0>> + detail::is_same_v && Dims == 0>> host_accessor(buffer &BufferRef, const property_list &PropertyList = {}) : AccessorT(BufferRef, PropertyList) {} diff --git a/sycl/include/CL/sycl/atomic.hpp b/sycl/include/CL/sycl/atomic.hpp index 74ea543d7d0e7..fe0f0cbb9ad22 100644 --- a/sycl/include/CL/sycl/atomic.hpp +++ b/sycl/include/CL/sycl/atomic.hpp @@ -20,7 +20,7 @@ #include #define __SYCL_STATIC_ASSERT_NOT_FLOAT(T) \ - static_assert(!std::is_same::value, \ + static_assert(!detail::is_same_v, \ "SYCL atomic function not available for float type") __SYCL_INLINE_NAMESPACE(cl) { @@ -38,11 +38,10 @@ using memory_order = cl::sycl::memory_order; template struct IsValidAtomicType { static constexpr bool value = - (std::is_same::value || std::is_same::value || - std::is_same::value || std::is_same::value || - std::is_same::value || - std::is_same::value || - std::is_same::value); + (detail::is_same_v || detail::is_same_v || + detail::is_same_v || detail::is_same_v || + detail::is_same_v || + detail::is_same_v || detail::is_same_v); }; template struct IsValidAtomicAddressSpace { @@ -224,13 +223,13 @@ class atomic { #ifdef __SYCL_DEVICE_ONLY__ template - detail::enable_if_t::value, T> + detail::enable_if_t, T> load(memory_order Order = memory_order::relaxed) const { return __spirv_AtomicLoad(Ptr, SpirvScope, detail::getSPIRVMemorySemanticsMask(Order)); } template - detail::enable_if_t::value, T> + detail::enable_if_t, T> load(memory_order Order = memory_order::relaxed) const { auto *TmpPtr = reinterpret_cast::pointer_t>( diff --git a/sycl/include/CL/sycl/backend/level_zero.hpp b/sycl/include/CL/sycl/backend/level_zero.hpp index 934b6d8c16802..54757af4ffddc 100644 --- a/sycl/include/CL/sycl/backend/level_zero.hpp +++ b/sycl/include/CL/sycl/backend/level_zero.hpp @@ -59,14 +59,14 @@ queue make_queue(const context &Context, pi_native_handle InteropHandle); // Construction of SYCL platform. template ::value> * = nullptr> + detail::is_same_v> * = nullptr> T make(typename interop::type Interop) { return make_platform(reinterpret_cast(Interop)); } // Construction of SYCL device. -template ::value> * = nullptr> +template > + * = nullptr> T make(const platform &Platform, typename interop::type Interop) { return make_device(Platform, reinterpret_cast(Interop)); @@ -74,15 +74,15 @@ T make(const platform &Platform, // Construction of SYCL program. template ::value> * = nullptr> + detail::is_same_v> * = nullptr> T make(const context &Context, typename interop::type Interop) { return make_program(Context, reinterpret_cast(Interop)); } // Construction of SYCL queue. -template ::value> * = nullptr> +template > * = nullptr> T make(const context &Context, typename interop::type Interop) { return make_queue(Context, reinterpret_cast(Interop)); diff --git a/sycl/include/CL/sycl/backend/opencl.hpp b/sycl/include/CL/sycl/backend/opencl.hpp index abd406260eb80..47d54bbf81725 100644 --- a/sycl/include/CL/sycl/backend/opencl.hpp +++ b/sycl/include/CL/sycl/backend/opencl.hpp @@ -67,36 +67,36 @@ __SYCL_EXPORT queue make_queue(const context &Context, // Construction of SYCL platform. template ::value> * = nullptr> + detail::is_same_v> * = nullptr> T make(typename interop::type Interop) { return make_platform(detail::pi::cast(Interop)); } // Construction of SYCL device. -template ::value> * = nullptr> +template > + * = nullptr> T make(typename interop::type Interop) { return make_device(detail::pi::cast(Interop)); } // Construction of SYCL context. template ::value> * = nullptr> + detail::is_same_v> * = nullptr> T make(typename interop::type Interop) { return make_context(detail::pi::cast(Interop)); } // Construction of SYCL program. template ::value> * = nullptr> + detail::is_same_v> * = nullptr> T make(const context &Context, typename interop::type Interop) { return make_program(Context, detail::pi::cast(Interop)); } // Construction of SYCL queue. -template ::value> * = nullptr> +template > * = nullptr> T make(const context &Context, typename interop::type Interop) { return make_queue(Context, detail::pi::cast(Interop)); diff --git a/sycl/include/CL/sycl/buffer.hpp b/sycl/include/CL/sycl/buffer.hpp index 8951e4c786f08..b76db7128f696 100755 --- a/sycl/include/CL/sycl/buffer.hpp +++ b/sycl/include/CL/sycl/buffer.hpp @@ -57,7 +57,7 @@ class buffer { std::input_iterator_tag>::value>; template using EnableIfSameNonConstIterators = typename detail::enable_if_t< - std::is_same::value && !std::is_const::value, ItA>; + detail::is_same_v && !std::is_const::value, ItA>; buffer(const range &bufferRange, const property_list &propList = {}) diff --git a/sycl/include/CL/sycl/detail/accessor_impl.hpp b/sycl/include/CL/sycl/detail/accessor_impl.hpp index 792e848e636b5..772f9bf63d57a 100644 --- a/sycl/include/CL/sycl/detail/accessor_impl.hpp +++ b/sycl/include/CL/sycl/detail/accessor_impl.hpp @@ -225,27 +225,24 @@ constexpr access::mode deduceAccessMode() { // property_list = {} is not properly detected by deduction guide, // when parameter is passed without curly braces: access(buffer, noinit) // thus simplest approach is to check 2 last arguments for being a tag - if constexpr (std::is_same>::value || - std::is_same>::value) { + if constexpr (detail::is_same_v> || + detail::is_same_v>) { return access::mode::read; } - if constexpr (std::is_same>::value || - std::is_same>::value) { + if constexpr (detail::is_same_v> || + detail::is_same_v>) { return access::mode::write; } - if constexpr ( - std::is_same>::value || - std::is_same>::value) { + if constexpr (detail::is_same_v< + MayBeTag1, + mode_target_tag_t> || + detail::is_same_v< + MayBeTag2, + mode_target_tag_t>) { return access::mode::read; } @@ -254,13 +251,14 @@ constexpr access::mode deduceAccessMode() { template constexpr access::target deduceAccessTarget(access::target defaultTarget) { - if constexpr ( - std::is_same>::value || - std::is_same>::value) { + if constexpr (detail::is_same_v< + MayBeTag1, + mode_target_tag_t> || + detail::is_same_v< + MayBeTag2, + mode_target_tag_t>) { return access::target::constant_buffer; } diff --git a/sycl/include/CL/sycl/detail/cg_types.hpp b/sycl/include/CL/sycl/detail/cg_types.hpp index 7e14e0aed035f..760693cb6cb0d 100644 --- a/sycl/include/CL/sycl/detail/cg_types.hpp +++ b/sycl/include/CL/sycl/detail/cg_types.hpp @@ -195,13 +195,13 @@ class HostKernel : public HostKernelBase { char *getPtr() override { return reinterpret_cast(&MKernel); } template - typename detail::enable_if_t::value> + typename detail::enable_if_t> runOnHost(const NDRDescT &) { MKernel(); } template - typename detail::enable_if_t>::value> + typename detail::enable_if_t>> runOnHost(const NDRDescT &NDRDesc) { sycl::range Range(InitializedVal::template get<0>()); sycl::id Offset; @@ -221,7 +221,7 @@ class HostKernel : public HostKernelBase { template typename detail::enable_if_t< - std::is_same>::value> + detail::is_same_v>> runOnHost(const NDRDescT &NDRDesc) { sycl::id ID; sycl::range Range(InitializedVal::template get<0>()); @@ -240,7 +240,7 @@ class HostKernel : public HostKernelBase { template typename detail::enable_if_t< - std::is_same>::value> + detail::is_same_v>> runOnHost(const NDRDescT &NDRDesc) { sycl::range Range(InitializedVal::template get<0>()); sycl::id Offset; @@ -260,7 +260,7 @@ class HostKernel : public HostKernelBase { } template - typename detail::enable_if_t>::value> + typename detail::enable_if_t>> runOnHost(const NDRDescT &NDRDesc) { sycl::range GroupSize(InitializedVal::template get<0>()); for (int I = 0; I < Dims; ++I) { @@ -305,7 +305,7 @@ class HostKernel : public HostKernelBase { } template - enable_if_t>::value> + enable_if_t>> runOnHost(const NDRDescT &NDRDesc) { sycl::range NGroups(InitializedVal::template get<0>()); diff --git a/sycl/include/CL/sycl/detail/generic_type_traits.hpp b/sycl/include/CL/sycl/detail/generic_type_traits.hpp index 6e3966028724d..7a10758e61303 100644 --- a/sycl/include/CL/sycl/detail/generic_type_traits.hpp +++ b/sycl/include/CL/sycl/detail/generic_type_traits.hpp @@ -296,7 +296,7 @@ template class TryToGetPointerT { public: using type = decltype(check(T())); static constexpr bool value = - std::is_pointer::value || !std::is_same::value; + std::is_pointer::value || !detail::is_same_v; }; // Try to get element_type, otherwise T @@ -306,7 +306,7 @@ template class TryToGetElementType { public: using type = decltype(check(T())); - static constexpr bool value = !std::is_same::value; + static constexpr bool value = !detail::is_same_v; }; // Try to get vector_t, otherwise T @@ -316,7 +316,7 @@ template class TryToGetVectorT { public: using type = decltype(check(T())); - static constexpr bool value = !std::is_same::value; + static constexpr bool value = !detail::is_same_v; }; // Try to get pointer_t (if pointer_t indicates on the type with_remainder @@ -395,7 +395,7 @@ using select_cl_scalar_t = conditional_t< std::is_floating_point::value, select_cl_scalar_float_t, // half is a special case: it is implemented differently on host and // device and therefore, might lower to different types - conditional_t::value, + conditional_t, cl::sycl::detail::half_impl::BIsRepresentationT, T>>>; // select_cl_vector_or_scalar does cl_* type selection for element type of @@ -410,7 +410,7 @@ struct select_cl_vector_or_scalar< // select_cl_scalar_t returns _Float16, so, we try to instantiate vec // class with _Float16 DataType, which is not expected there // So, leave vector as-is - vec::value, + vec, typename T::element_type, select_cl_scalar_t>, T::get_count()>; diff --git a/sycl/include/CL/sycl/detail/stl_type_traits.hpp b/sycl/include/CL/sycl/detail/stl_type_traits.hpp index 03403b7ba063e..ccf261969f77c 100644 --- a/sycl/include/CL/sycl/detail/stl_type_traits.hpp +++ b/sycl/include/CL/sycl/detail/stl_type_traits.hpp @@ -36,6 +36,9 @@ using remove_reference_t = typename std::remove_reference::type; template using add_pointer_t = typename std::add_pointer::type; +template +constexpr bool is_same_v = std::is_same::value; + // C++17 template using bool_constant = std::integral_constant; diff --git a/sycl/include/CL/sycl/detail/sycl_mem_obj_allocator.hpp b/sycl/include/CL/sycl/detail/sycl_mem_obj_allocator.hpp index 827a54ff9f6af..1b75c835bdded 100644 --- a/sycl/include/CL/sycl/detail/sycl_mem_obj_allocator.hpp +++ b/sycl/include/CL/sycl/detail/sycl_mem_obj_allocator.hpp @@ -37,11 +37,11 @@ class SYCLMemObjAllocatorHolder : public SYCLMemObjAllocator { template using EnableIfDefaultAllocator = - enable_if_t::value>; + enable_if_t>; template using EnableIfNonDefaultAllocator = - enable_if_t::value>; + enable_if_t>; public: SYCLMemObjAllocatorHolder(AllocatorT Allocator) diff --git a/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp b/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp index 2dd5ba8d427ca..1ba9beaeec39c 100644 --- a/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp +++ b/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp @@ -55,11 +55,11 @@ class __SYCL_EXPORT SYCLMemObjT : public SYCLMemObjI { template using EnableIfDefaultAllocator = - enable_if_t::value>; + enable_if_t>; template using EnableIfNonDefaultAllocator = - enable_if_t::value>; + enable_if_t>; public: SYCLMemObjT(const size_t SizeInBytes, const property_list &Props, diff --git a/sycl/include/CL/sycl/detail/type_list.hpp b/sycl/include/CL/sycl/detail/type_list.hpp index 2caeabe384e58..fa224023203e0 100644 --- a/sycl/include/CL/sycl/detail/type_list.hpp +++ b/sycl/include/CL/sycl/detail/type_list.hpp @@ -25,9 +25,8 @@ template struct type_list; using empty_type_list = type_list<>; template -struct is_empty_type_list - : conditional_t::value, std::true_type, - std::false_type> {}; +struct is_empty_type_list : conditional_t, + std::true_type, std::false_type> {}; template <> struct type_list<> {}; @@ -52,7 +51,7 @@ struct type_list, T2...> { // is_contained template struct is_contained - : conditional_t, head_t>::value, + : conditional_t, head_t>, std::true_type, is_contained>> {}; template diff --git a/sycl/include/CL/sycl/detail/type_traits.hpp b/sycl/include/CL/sycl/detail/type_traits.hpp index ee2a3bd9a327d..a41bc966a7ede 100644 --- a/sycl/include/CL/sycl/detail/type_traits.hpp +++ b/sycl/include/CL/sycl/detail/type_traits.hpp @@ -209,8 +209,8 @@ struct is_vector_arithmetic // is_bool template -struct is_scalar_bool - : bool_constant, bool>::value> {}; +struct is_scalar_bool : bool_constant, bool>> { +}; template struct is_vector_bool @@ -299,7 +299,7 @@ template struct make_larger_impl, vec> { using base_type = vector_element_t>; using upper_type = typename make_larger_impl::type; using new_type = vec; - static constexpr bool found = !std::is_same::value; + static constexpr bool found = !detail::is_same_v; using type = conditional_t; }; diff --git a/sycl/include/CL/sycl/handler.hpp b/sycl/include/CL/sycl/handler.hpp index 4bdffaacc6570..b7a739dab7d5a 100644 --- a/sycl/include/CL/sycl/handler.hpp +++ b/sycl/include/CL/sycl/handler.hpp @@ -161,8 +161,8 @@ template struct NotIntMsg> { #if __SYCL_ID_QUERIES_FIT_IN_INT__ template -typename detail::enable_if_t::value || - std::is_same::value> +typename detail::enable_if_t || + detail::is_same_v> checkValueRangeImpl(ValT V) { static constexpr size_t Limit = static_cast((std::numeric_limits::max)()); @@ -172,8 +172,8 @@ checkValueRangeImpl(ValT V) { #endif template -typename detail::enable_if_t>::value || - std::is_same>::value> +typename detail::enable_if_t> || + detail::is_same_v>> checkValueRange(const T &V) { #if __SYCL_ID_QUERIES_FIT_IN_INT__ for (size_t Dim = 0; Dim < Dims; ++Dim) @@ -210,7 +210,7 @@ void checkValueRange(const range &R, const id &O) { } template -typename detail::enable_if_t>::value> +typename detail::enable_if_t>> checkValueRange(const T &V) { #if __SYCL_ID_QUERIES_FIT_IN_INT__ checkValueRange(V.get_global_range()); @@ -430,7 +430,7 @@ class __SYCL_EXPORT handler { template void setArgHelper(int ArgIndex, T &&Arg) { auto StoredArg = static_cast(storePlainArg(Arg)); - if (!std::is_same::value && std::is_pointer::value) { + if (!detail::is_same_v && std::is_pointer::value) { MArgs.emplace_back(detail::kernel_param_kind_t::kind_pointer, StoredArg, sizeof(T), ArgIndex); } else { @@ -852,7 +852,8 @@ class __SYCL_EXPORT handler { typename detail::remove_cv_t>; template - using is_same_type = std::is_same, remove_cv_ref_t>; + static constexpr bool is_same_type_v = + detail::is_same_v, remove_cv_ref_t>; template struct ShouldEnableSetArg { static constexpr bool value = @@ -860,10 +861,10 @@ class __SYCL_EXPORT handler { #if SYCL_LANGUAGE_VERSION && SYCL_LANGUAGE_VERSION <= 201707 && std::is_standard_layout>::value #endif - || is_same_type::value // Sampler - || (!is_same_type::value && + || is_same_type_v // Sampler + || (!is_same_type_v && std::is_pointer>::value) // USM - || is_same_type::value; // Interop + || is_same_type_v; // Interop }; /// Sets argument for OpenCL interoperability kernels. diff --git a/sycl/include/CL/sycl/multi_ptr.hpp b/sycl/include/CL/sycl/multi_ptr.hpp index c3a298c9bfbc7..a5267ad9aedc4 100644 --- a/sycl/include/CL/sycl/multi_ptr.hpp +++ b/sycl/include/CL/sycl/multi_ptr.hpp @@ -29,9 +29,9 @@ class accessor; template class multi_ptr { public: using element_type = - detail::conditional_t::value, - cl::sycl::detail::half_impl::BIsRepresentationT, - ElementType>; + detail::conditional_t, + cl::sycl::detail::half_impl::BIsRepresentationT, + ElementType>; using difference_type = std::ptrdiff_t; // Implementation defined pointer and reference types that correspond to @@ -156,15 +156,14 @@ template class multi_ptr { // Only if Space == global_space || global_device_space and element type is // const - template < - int dimensions, access::mode Mode, access::placeholder isPlaceholder, - typename PropertyListT, access::address_space _Space = Space, - typename ET = ElementType, - typename = typename detail::enable_if_t< - _Space == Space && - (Space == access::address_space::global_space || - Space == access::address_space::global_device_space) && - std::is_const::value && std::is_same::value>> + template ::value && detail::is_same_v>> multi_ptr( accessor, dimensions, Mode, access::target::global_buffer, isPlaceholder, PropertyListT> @@ -178,7 +177,7 @@ template class multi_ptr { typename ET = ElementType, typename = typename detail::enable_if_t< _Space == Space && Space == access::address_space::local_space && - std::is_const::value && std::is_same::value>> + std::is_const::value && detail::is_same_v>> multi_ptr(accessor, dimensions, Mode, access::target::local, isPlaceholder, PropertyListT> Accessor) @@ -191,7 +190,7 @@ template class multi_ptr { typename ET = ElementType, typename = typename detail::enable_if_t< _Space == Space && Space == access::address_space::constant_space && - std::is_const::value && std::is_same::value>> + std::is_const::value && detail::is_same_v>> multi_ptr( accessor, dimensions, Mode, access::target::constant_buffer, isPlaceholder, PropertyListT> @@ -206,7 +205,7 @@ template class multi_ptr { // multi_ptr -> multi_ptr template multi_ptr(typename detail::enable_if_t< - std::is_const::value && std::is_same::value, + std::is_const::value && detail::is_same_v, const multi_ptr, Space>> &ETP) : m_Pointer(ETP.get()) {} @@ -220,7 +219,7 @@ template class multi_ptr { // Only available when ElementType is not const-qualified template operator multi_ptr< - typename detail::enable_if_t::value && + typename detail::enable_if_t && !std::is_const::value, void>::type, Space>() const { @@ -232,7 +231,7 @@ template class multi_ptr { // Only available when ElementType is const-qualified template operator multi_ptr< - typename detail::enable_if_t::value && + typename detail::enable_if_t && std::is_const::value, const void>::type, Space>() const { diff --git a/sycl/include/CL/sycl/stream.hpp b/sycl/include/CL/sycl/stream.hpp index f2704b7491034..abf57bef7be4d 100644 --- a/sycl/include/CL/sycl/stream.hpp +++ b/sycl/include/CL/sycl/stream.hpp @@ -55,9 +55,9 @@ constexpr size_t MAX_ARRAY_SIZE = template using EnableIfFP = - typename detail::enable_if_t::value || - std::is_same::value || - std::is_same::value, + typename detail::enable_if_t || + detail::is_same_v || + detail::is_same_v, T>; using GlobalBufAccessorT = accessor inline typename detail::enable_if_t< - std::is_same::value || std::is_same::value, unsigned> + detail::is_same_v || detail::is_same_v, unsigned> checkForInfNan(char *Buf, T Val) { if (isnan(Val)) return append(Buf, "nan"); @@ -199,7 +199,7 @@ checkForInfNan(char *Buf, T Val) { } template -inline typename detail::enable_if_t::value, unsigned> +inline typename detail::enable_if_t, unsigned> checkForInfNan(char *Buf, T Val) { if (Val != Val) return append(Buf, "nan"); diff --git a/sycl/include/CL/sycl/types.hpp b/sycl/include/CL/sycl/types.hpp index 5f1b895193cd9..c65dcd238e77f 100644 --- a/sycl/include/CL/sycl/types.hpp +++ b/sycl/include/CL/sycl/types.hpp @@ -242,13 +242,14 @@ using is_float_to_float = std::integral_constant::value && detail::is_floating_point::value>; template -using is_standard_type = std::integral_constant< - bool, detail::is_sgentype::value && !std::is_same::value && - !std::is_same::value>; +using is_standard_type = + std::integral_constant::value && + !detail::is_same_v && + !detail::is_same_v>; template -detail::enable_if_t::value, R> convertImpl(T Value) { +detail::enable_if_t, R> convertImpl(T Value) { return Value; } @@ -258,7 +259,7 @@ detail::enable_if_t::value, R> convertImpl(T Value) { // implemented for host that takes care of the precision requirements. template -detail::enable_if_t::value && +detail::enable_if_t && (is_int_to_int::value || is_int_to_float::value || is_float_to_float::value), @@ -320,7 +321,7 @@ using Rtn = detail::bool_constant; template detail::enable_if_t< - !std::is_same::value && std::is_same::value, R> + !detail::is_same_v && detail::is_same_v, R> convertImpl(T Value) { return static_cast(Value); } @@ -330,10 +331,10 @@ convertImpl(T Value) { template \ detail::enable_if_t::value && \ - !std::is_same::value && \ - (std::is_same::value || \ - (std::is_same::value && \ - std::is_same::value)), \ + !detail::is_same_v && \ + (detail::is_same_v || \ + (detail::is_same_v && \ + detail::is_same_v)), \ R> \ convertImpl(T Value) { \ OpenCLT OpValue = cl::sycl::detail::convertDataToType(Value); \ @@ -352,8 +353,8 @@ __SYCL_GENERATE_CONVERT_IMPL(long) template \ detail::enable_if_t::value && \ - !std::is_same::value && \ - std::is_same::value, \ + !detail::is_same_v && \ + detail::is_same_v, \ R> \ convertImpl(T Value) { \ OpenCLT OpValue = cl::sycl::detail::convertDataToType(Value); \ @@ -383,9 +384,9 @@ convertImpl(T Value) { template \ detail::enable_if_t::value && \ - (std::is_same::value || \ - (std::is_same::value && \ - std::is_same::value)), \ + (detail::is_same_v || \ + (detail::is_same_v && \ + detail::is_same_v)), \ R> \ convertImpl(T Value) { \ OpenCLT OpValue = cl::sycl::detail::convertDataToType(Value); \ @@ -403,9 +404,9 @@ __SYCL_GENERATE_CONVERT_IMPL(SToF, double) template \ detail::enable_if_t::value && \ - (std::is_same::value || \ - (std::is_same::value && \ - std::is_same::value)), \ + (detail::is_same_v || \ + (detail::is_same_v && \ + detail::is_same_v)), \ R> \ convertImpl(T Value) { \ OpenCLT OpValue = cl::sycl::detail::convertDataToType(Value); \ @@ -424,10 +425,10 @@ __SYCL_GENERATE_CONVERT_IMPL(UToF, double) template \ detail::enable_if_t::value && \ - !std::is_same::value && \ - (std::is_same::value || \ - (std::is_same::value && \ - std::is_same::value)) && \ + !detail::is_same_v && \ + (detail::is_same_v || \ + (detail::is_same_v && \ + detail::is_same_v)) && \ RoundingModeCondition::value, \ R> \ convertImpl(T Value) { \ @@ -454,12 +455,14 @@ __SYCL_GENERATE_CONVERT_IMPL_FOR_ROUNDING_MODE(rtn, Rtn) RoundingModeCondition) \ template \ - detail::enable_if_t::value && \ - (std::is_same::value || \ - std::is_same::value && \ - std::is_same::value) && \ - RoundingModeCondition::value, \ - R> \ + detail::enable_if_t< \ + is_float_to_int::value && \ + (detail::is_same_v || \ + detail::is_same_v && \ + detail::is_same_v< \ + DestType, \ + char>)&&RoundingModeCondition::value, \ + R> \ convertImpl(T Value) { \ OpenCLT OpValue = cl::sycl::detail::convertDataToType(Value); \ return __spirv_Convert##SPIRVOp##_R##DestType##_##RoundingMode(OpValue); \ @@ -496,7 +499,7 @@ template ::value && !is_standard_type::value) || (!is_standard_type::value && !is_standard_type::value)) && - !std::is_same::value, + !detail::is_same_v, R> convertImpl(T Value) { return static_cast(Value); @@ -661,7 +664,7 @@ template class vec { // W/o this, things like "vec = vec" doesn't work. template - typename detail::enable_if_t::value && + typename detail::enable_if_t && std::is_convertible::value, vec &> operator=(const vec &Rhs) { @@ -672,15 +675,15 @@ template class vec { #ifdef __SYCL_USE_EXT_VECTOR_TYPE__ template using EnableIfNotHostHalf = typename detail::enable_if_t< - !std::is_same::value || - !std::is_same::value, + !detail::is_same_v || + !detail::is_same_v, T>; template using EnableIfHostHalf = typename detail::enable_if_t< - std::is_same::value && - std::is_same::value, + detail::is_same_v && + detail::is_same_v, T>; template @@ -691,7 +694,7 @@ template class vec { template typename detail::enable_if_t< std::is_fundamental::value || - std::is_same, half>::value, + detail::is_same_v, half>, vec &> operator=(const EnableIfNotHostHalf &Rhs) { m_Data = (DataType)Rhs; @@ -707,7 +710,7 @@ template class vec { template typename detail::enable_if_t< std::is_fundamental::value || - std::is_same, half>::value, + detail::is_same_v, half>, vec &> operator=(const EnableIfHostHalf &Rhs) { for (int i = 0; i < NumElements; ++i) { @@ -725,7 +728,7 @@ template class vec { template typename detail::enable_if_t< std::is_fundamental::value || - std::is_same, half>::value, + detail::is_same_v, half>, vec &> operator=(const DataT &Rhs) { for (int i = 0; i < NumElements; ++i) { @@ -792,8 +795,8 @@ template class vec { #ifdef __SYCL_DEVICE_ONLY__ template ::value && - !std::is_same::value>> + detail::is_same_v && + !detail::is_same_v>> vec(vector_t openclVector) : m_Data(openclVector) {} operator vector_t() const { return m_Data; } #endif @@ -948,7 +951,7 @@ template class vec { typename detail::enable_if_t< \ std::is_convertible::value && \ (std::is_fundamental::value || \ - std::is_same, half>::value), \ + detail::is_same_v, half>), \ vec> \ operator BINOP(const T &Rhs) const { \ return *this BINOP vec(static_cast(Rhs)); \ @@ -976,7 +979,7 @@ template class vec { typename detail::enable_if_t< \ std::is_convertible::value && \ (std::is_fundamental::value || \ - std::is_same, half>::value), \ + detail::is_same_v, half>), \ vec> \ operator BINOP(const T &Rhs) const { \ return *this BINOP vec(static_cast(Rhs)); \ @@ -1034,7 +1037,7 @@ template class vec { template \ typename detail::enable_if_t::value && \ (std::is_fundamental::value || \ - std::is_same::value), \ + detail::is_same_v), \ vec> \ operator RELLOGOP(const T &Rhs) const { \ return *this RELLOGOP vec(static_cast(Rhs)); \ @@ -1051,7 +1054,7 @@ template class vec { template \ typename detail::enable_if_t::value && \ (std::is_fundamental::value || \ - std::is_same::value), \ + detail::is_same_v), \ vec> \ operator RELLOGOP(const T &Rhs) const { \ return *this RELLOGOP vec(static_cast(Rhs)); \ @@ -1325,8 +1328,8 @@ template class vec { #ifdef __cpp_deduction_guides // all compilers supporting deduction guides also support fold expressions template ::value && ...)>> -vec(T, U...)->vec; + class = detail::enable_if_t<(detail::is_same_v && ...)>> +vec(T, U...) -> vec; #endif namespace detail { @@ -1379,13 +1382,13 @@ class SwizzleOp { using EnableIfScalarType = typename detail::enable_if_t< std::is_convertible::value && (std::is_fundamental::value || - std::is_same, half>::value)>; + detail::is_same_v, half>)>; template using EnableIfNoScalarType = typename detail::enable_if_t< !std::is_convertible::value || !(std::is_fundamental::value || - std::is_same, half>::value)>; + detail::is_same_v, half>)>; template using Swizzle = @@ -1848,7 +1851,7 @@ class SwizzleOp { template CommonDataT getValue(EnableIfOneIndex Index) const { - if (std::is_same, GetOp>::value) { + if (detail::is_same_v, GetOp>) { std::array Idxs{Indexes...}; return m_Vector->getValue(Idxs[Index]); } @@ -1859,7 +1862,7 @@ class SwizzleOp { template DataT getValue(EnableIfMultipleIndexes Index) const { - if (std::is_same, GetOp>::value) { + if (detail::is_same_v, GetOp>) { std::array Idxs{Indexes...}; return m_Vector->getValue(Idxs[Index]); } @@ -1903,7 +1906,7 @@ class SwizzleOp { template \ typename detail::enable_if_t< \ std::is_fundamental::value || \ - std::is_same, half>::value, \ + detail::is_same_v, half>, \ vec> \ operator BINOP(const T &Lhs, const vec &Rhs) { \ return vec(Lhs) BINOP Rhs; \ @@ -1915,7 +1918,7 @@ class SwizzleOp { typename detail::enable_if_t< \ std::is_convertible::value && \ (std::is_fundamental::value || \ - std::is_same, half>::value), \ + detail::is_same_v, half>), \ vec> \ operator BINOP( \ const T &Lhs, \ @@ -1958,7 +1961,7 @@ __SYCL_BINOP(<<) typename detail::enable_if_t< \ std::is_convertible::value && \ (std::is_fundamental::value || \ - std::is_same, half>::value), \ + detail::is_same_v, half>), \ vec, Num>> \ operator RELLOGOP(const T &Lhs, const vec &Rhs) { \ return vec(static_cast(Lhs)) RELLOGOP Rhs; \ @@ -1970,7 +1973,7 @@ __SYCL_BINOP(<<) typename detail::enable_if_t< \ std::is_convertible::value && \ (std::is_fundamental::value || \ - std::is_same, half>::value), \ + detail::is_same_v, half>), \ vec, Num>> \ operator RELLOGOP( \ const T &Lhs, \ diff --git a/sycl/source/detail/scheduler/graph_builder.cpp b/sycl/source/detail/scheduler/graph_builder.cpp index 346b9f33dafae..2a4dd254b7ffe 100644 --- a/sycl/source/detail/scheduler/graph_builder.cpp +++ b/sycl/source/detail/scheduler/graph_builder.cpp @@ -688,7 +688,7 @@ void Scheduler::GraphBuilder::markModifiedIfWrite(MemObjRecord *Record, template typename detail::enable_if_t< - std::is_same, Requirement>::value, + detail::is_same_v, Requirement>, EmptyCommand *> Scheduler::GraphBuilder::addEmptyCmd(Command *Cmd, const std::vector &Reqs, const QueueImplPtr &Queue, diff --git a/sycl/source/detail/scheduler/scheduler.hpp b/sycl/source/detail/scheduler/scheduler.hpp index 2665365dde815..57bac1e832d14 100644 --- a/sycl/source/detail/scheduler/scheduler.hpp +++ b/sycl/source/detail/scheduler/scheduler.hpp @@ -583,7 +583,7 @@ class Scheduler { template typename detail::enable_if_t< - std::is_same, Requirement>::value, + detail::is_same_v, Requirement>, EmptyCommand *> addEmptyCmd(Command *Cmd, const std::vector &Req, const QueueImplPtr &Queue, Command::BlockReason Reason); From 7e69de474b72462117c05c9ed489558a479592fc Mon Sep 17 00:00:00 2001 From: Artem Gindinson Date: Tue, 17 Nov 2020 09:42:02 +0300 Subject: [PATCH 2/3] Use a namespace alias for sycl::detail Signed-off-by: Artem Gindinson --- .../sycl/INTEL/esimd/detail/esimd_intrin.hpp | 2 +- .../sycl/INTEL/esimd/detail/esimd_types.hpp | 7 ++- .../CL/sycl/INTEL/esimd/detail/esimd_util.hpp | 50 ++++++++----------- sycl/include/CL/sycl/INTEL/esimd/esimd.hpp | 2 +- .../CL/sycl/INTEL/esimd/esimd_math.hpp | 15 +++--- 5 files changed, 34 insertions(+), 42 deletions(-) diff --git a/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_intrin.hpp b/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_intrin.hpp index 111fd37c3e024..292f4a1b672b5 100644 --- a/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_intrin.hpp +++ b/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_intrin.hpp @@ -179,7 +179,7 @@ readRegion(const vector_type_t &Base, std::pair Region) { return readRegion(Base1, Region.first); else { static_assert(T::Is_2D); - static_assert(sycl::detail::is_same_v); + static_assert(csd::is_same_v); // To read a 2D region, we need the parent region // Read full rows with non-trivial vertical and horizontal stride = 1. constexpr int M = T::Size_y * PaTy::Size_x; diff --git a/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_types.hpp b/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_types.hpp index aae6535aff487..590ff96d5b67f 100644 --- a/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_types.hpp +++ b/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_types.hpp @@ -209,7 +209,7 @@ template constexpr bool is_type() { return false; } template constexpr bool is_type() { using UU = typename detail::remove_const_t; using TT = typename detail::remove_const_t; - return sycl::detail::is_same_v || is_type(); + return csd::is_same_v || is_type(); } // calculates the number of elements in "To" type @@ -228,13 +228,12 @@ struct bitcast_helper { template ::value>> ESIMD_INLINE typename detail::conditional_t< - sycl::detail::is_same_v, - vector_type_t, + csd::is_same_v, vector_type_t, vector_type_t::nToElems()>> bitcast(vector_type_t Val) { // Noop. - if constexpr (sycl::detail::is_same_v) + if constexpr (csd::is_same_v) return Val; // Bitcast diff --git a/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_util.hpp b/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_util.hpp index 5bd1c5db2d62b..1cfc26ddf6651 100755 --- a/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_util.hpp +++ b/sycl/include/CL/sycl/INTEL/esimd/detail/esimd_util.hpp @@ -100,11 +100,10 @@ struct is_esimd_scalar template struct is_dword_type : std::integral_constant< - bool, - sycl::detail::is_same_v> || - sycl::detail::is_same_v< - unsigned int, typename sycl::detail::remove_const_t>> {}; + bool, csd::is_same_v> || + csd::is_same_v>> { +}; template struct is_dword_type> { @@ -120,10 +119,9 @@ template struct is_word_type : std::integral_constant< bool, - sycl::detail::is_same_v> || - sycl::detail::is_same_v< - unsigned short, typename sycl::detail::remove_const_t>> {}; + csd::is_same_v> || + csd::is_same_v>> {}; template struct is_word_type> { @@ -138,10 +136,9 @@ template struct is_byte_type : std::integral_constant< bool, - sycl::detail::is_same_v> || - sycl::detail::is_same_v< - unsigned char, typename sycl::detail::remove_const_t>> {}; + csd::is_same_v> || + csd::is_same_v>> {}; template struct is_byte_type> { @@ -155,34 +152,31 @@ template struct is_byte_type> { template struct is_fp_type : std::integral_constant< - bool, sycl::detail::is_same_v< - float, typename sycl::detail::remove_const_t>> {}; + bool, + csd::is_same_v>> {}; template struct is_df_type : std::integral_constant< - bool, sycl::detail::is_same_v< - double, typename sycl::detail::remove_const_t>> {}; + bool, + csd::is_same_v>> {}; template struct is_fp_or_dword_type : std::integral_constant< bool, - sycl::detail::is_same_v> || - sycl::detail::is_same_v< - int, typename sycl::detail::remove_const_t> || - sycl::detail::is_same_v< - unsigned int, typename sycl::detail::remove_const_t>> {}; + csd::is_same_v> || + csd::is_same_v> || + csd::is_same_v>> {}; template struct is_qword_type : std::integral_constant< - bool, sycl::detail::is_same_v< - long long, typename sycl::detail::remove_const_t> || - sycl::detail::is_same_v< - unsigned long long, - typename sycl::detail::remove_const_t>> {}; + bool, + csd::is_same_v> || + csd::is_same_v>> {}; template struct is_qword_type> { diff --git a/sycl/include/CL/sycl/INTEL/esimd/esimd.hpp b/sycl/include/CL/sycl/INTEL/esimd/esimd.hpp index b3437c7c9dcf6..af145bf01eaa8 100644 --- a/sycl/include/CL/sycl/INTEL/esimd/esimd.hpp +++ b/sycl/include/CL/sycl/INTEL/esimd/esimd.hpp @@ -403,7 +403,7 @@ template class simd { Base1 = __esimd_wrregion(Base1, Val, Offset); } else { - static_assert(sycl::detail::is_same_v); + static_assert(csd::is_same_v); // Read columns with non-trivial horizontal stride. constexpr int M = TR::length; constexpr int VS = PaTy::Size_x * TR::Stride_y; diff --git a/sycl/include/CL/sycl/INTEL/esimd/esimd_math.hpp b/sycl/include/CL/sycl/INTEL/esimd/esimd_math.hpp index dc1bf201ac3d9..5930dad8c30b4 100644 --- a/sycl/include/CL/sycl/INTEL/esimd/esimd_math.hpp +++ b/sycl/include/CL/sycl/INTEL/esimd/esimd_math.hpp @@ -73,8 +73,8 @@ __esimd_abs_common_internal(T1 src0, int flag = GENX_NOSAT) { template ESIMD_NODEBUG ESIMD_INLINE typename sycl::detail::enable_if_t< - !sycl::detail::is_same_v, - typename sycl::detail::remove_const_t>, + !csd::is_same_v, + typename sycl::detail::remove_const_t>, simd> esimd_abs(simd src0, int flag = GENX_NOSAT) { return detail::__esimd_abs_common_internal(src0, flag); @@ -82,8 +82,8 @@ esimd_abs(simd src0, int flag = GENX_NOSAT) { template ESIMD_NODEBUG ESIMD_INLINE typename sycl::detail::enable_if_t< - !sycl::detail::is_same_v, - typename sycl::detail::remove_const_t> && + !csd::is_same_v, + typename sycl::detail::remove_const_t> && detail::is_esimd_scalar::value && detail::is_esimd_scalar::value, typename sycl::detail::remove_const_t> @@ -1905,12 +1905,11 @@ ESIMD_INLINE ESIMD_NODEBUG T0 hmin(simd v) { template ESIMD_INLINE ESIMD_NODEBUG T0 reduce(simd v, BinaryOperation op) { - if constexpr (sycl::detail::is_same_v, - std::plus<>>) { + if constexpr (csd::is_same_v, std::plus<>>) { T0 retv = detail::esimd_sum(v); return retv; - } else if constexpr (sycl::detail::is_same_v, - std::multiplies<>>) { + } else if constexpr (csd::is_same_v, + std::multiplies<>>) { T0 retv = detail::esimd_prod(v); return retv; } From b4fd5f5849b25914fcfe9f16cf0de18c9d5b8ba1 Mon Sep 17 00:00:00 2001 From: Artem Gindinson Date: Tue, 17 Nov 2020 10:41:24 +0300 Subject: [PATCH 3/3] Apply clang-format, as weird as it may seem Signed-off-by: Artem Gindinson --- sycl/include/CL/sycl/ONEAPI/reduction.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sycl/include/CL/sycl/ONEAPI/reduction.hpp b/sycl/include/CL/sycl/ONEAPI/reduction.hpp index ae8e87459c58d..92aee66f27395 100644 --- a/sycl/include/CL/sycl/ONEAPI/reduction.hpp +++ b/sycl/include/CL/sycl/ONEAPI/reduction.hpp @@ -84,9 +84,9 @@ template using IsReduOptForFastReduce = detail::bool_constant<( is_geninteger32bit::value || is_geninteger64bit::value || detail::is_same_v || detail::is_same_v || - detail::is_same_v) && (IsReduPlus::value || - IsReduMinimum::value || - IsReduMaximum::value)>; + detail::is_same_v)&&(IsReduPlus::value || + IsReduMinimum::value || + IsReduMaximum::value)>; // Identity = 0 template @@ -97,7 +97,7 @@ using IsZeroIdentityOp = bool_constant< IsReduBitOR::value || IsReduBitXOR::value)) || ((detail::is_same_v || detail::is_same_v || - detail::is_same_v) && IsReduPlus::value)>; + detail::is_same_v)&&IsReduPlus::value)>; // Identity = 1 template @@ -105,7 +105,7 @@ using IsOneIdentityOp = bool_constant<( is_geninteger8bit::value || is_geninteger16bit::value || is_geninteger32bit::value || is_geninteger64bit::value || detail::is_same_v || detail::is_same_v || - detail::is_same_v) && IsReduMultiplies::value>; + detail::is_same_v)&&IsReduMultiplies::value>; // Identity = ~0 template @@ -128,7 +128,7 @@ using IsMaximumIdentityOp = bool_constant<( is_geninteger8bit::value || is_geninteger16bit::value || is_geninteger32bit::value || is_geninteger64bit::value || detail::is_same_v || detail::is_same_v || - detail::is_same_v) && IsReduMaximum::value>; + detail::is_same_v)&&IsReduMaximum::value>; template using IsKnownIdentityOp =