From 8d1f841e35de445e098f883dfa15a686057b1243 Mon Sep 17 00:00:00 2001 From: aelovikov-intel Date: Wed, 7 Dec 2022 08:42:55 -0800 Subject: [PATCH 1/2] [NFC][SYCL] Switch to std:: equivalents for utilities in stl_type_traits.hpp Re-commits #7628 and #7668 that were previously reverted due to build issues on RHEL systems. The issues were fixed by introducing `SYCL_LIBDEVICE_GCC_TOOLCHAIN` cmake configuration option in #7771. --- sycl/include/CL/__spirv/spirv_ops.hpp | 6 +- sycl/include/sycl/accessor.hpp | 250 ++++---- sycl/include/sycl/atomic.hpp | 8 +- sycl/include/sycl/atomic_ref.hpp | 17 +- sycl/include/sycl/backend/opencl.hpp | 14 +- sycl/include/sycl/buffer.hpp | 30 +- sycl/include/sycl/builtins.hpp | 567 +++++++++--------- sycl/include/sycl/context.hpp | 5 +- sycl/include/sycl/detail/array.hpp | 10 +- sycl/include/sycl/detail/cg_types.hpp | 12 +- sycl/include/sycl/detail/common.hpp | 6 +- .../sycl/detail/generic_type_lists.hpp | 51 +- .../sycl/detail/generic_type_traits.hpp | 130 ++-- sycl/include/sycl/detail/helpers.hpp | 10 +- .../sycl/detail/image_accessor_util.hpp | 19 +- .../sycl/detail/property_list_base.hpp | 24 +- sycl/include/sycl/detail/spirv.hpp | 94 +-- sycl/include/sycl/detail/stl_type_traits.hpp | 40 +- .../sycl/detail/sycl_mem_obj_allocator.hpp | 4 +- sycl/include/sycl/detail/type_list.hpp | 30 +- sycl/include/sycl/detail/type_traits.hpp | 69 ++- sycl/include/sycl/detail/vector_traits.hpp | 6 +- sycl/include/sycl/device.hpp | 5 +- .../ext/intel/esimd/detail/memory_intrin.hpp | 2 +- .../ext/intel/esimd/detail/simd_obj_impl.hpp | 2 +- .../ext/intel/esimd/detail/simd_view_impl.hpp | 17 +- .../sycl/ext/intel/esimd/detail/sycl_util.hpp | 2 +- sycl/include/sycl/ext/intel/esimd/memory.hpp | 10 +- sycl/include/sycl/ext/intel/esimd/simd.hpp | 4 +- .../ext/intel/experimental/esimd/math.hpp | 4 +- .../ext/intel/experimental/fpga_utils.hpp | 4 +- .../ext/oneapi/accessor_property_list.hpp | 26 +- .../sycl/ext/oneapi/atomic_accessor.hpp | 6 +- sycl/include/sycl/ext/oneapi/atomic_ref.hpp | 20 +- .../sycl/ext/oneapi/backend/level_zero.hpp | 14 +- .../oneapi/device_global/device_global.hpp | 6 +- .../ext/oneapi/device_global/properties.hpp | 2 +- .../sycl/ext/oneapi/experimental/builtins.hpp | 8 +- .../ext/oneapi/experimental/group_sort.hpp | 7 +- .../ext/oneapi/experimental/spec_constant.hpp | 7 +- .../experimental/user_defined_reductions.hpp | 10 +- sycl/include/sycl/ext/oneapi/functional.hpp | 12 +- .../sycl/ext/oneapi/group_algorithm.hpp | 288 +++++---- .../oneapi/kernel_properties/properties.hpp | 7 +- .../sycl/ext/oneapi/properties/properties.hpp | 9 +- .../ext/oneapi/properties/property_utils.hpp | 17 +- .../ext/oneapi/properties/property_value.hpp | 4 +- sycl/include/sycl/ext/oneapi/sub_group.hpp | 8 +- .../sycl/ext/oneapi/sub_group_mask.hpp | 20 +- sycl/include/sycl/group.hpp | 40 +- sycl/include/sycl/group_algorithm.hpp | 224 +++---- sycl/include/sycl/handler.hpp | 61 +- sycl/include/sycl/id.hpp | 6 +- sycl/include/sycl/image.hpp | 18 +- sycl/include/sycl/interop_handle.hpp | 4 +- sycl/include/sycl/item.hpp | 12 +- sycl/include/sycl/kernel_bundle.hpp | 6 +- sycl/include/sycl/known_identity.hpp | 97 +-- sycl/include/sycl/multi_ptr.hpp | 122 ++-- sycl/include/sycl/nd_item.hpp | 8 +- sycl/include/sycl/property_list.hpp | 6 +- sycl/include/sycl/queue.hpp | 12 +- sycl/include/sycl/range.hpp | 8 +- sycl/include/sycl/reduction.hpp | 112 ++-- sycl/include/sycl/stream.hpp | 40 +- sycl/include/sycl/types.hpp | 276 +++++---- sycl/source/detail/buffer_impl.hpp | 2 +- sycl/source/detail/builtins_geometric.cpp | 25 +- sycl/source/detail/builtins_relational.cpp | 7 +- sycl/source/detail/pi.cpp | 2 +- sycl/source/detail/sycl_mem_obj_t.hpp | 4 +- 71 files changed, 1464 insertions(+), 1551 deletions(-) diff --git a/sycl/include/CL/__spirv/spirv_ops.hpp b/sycl/include/CL/__spirv/spirv_ops.hpp index bac846bcb225b..ef2fc51ce7a2e 100644 --- a/sycl/include/CL/__spirv/spirv_ops.hpp +++ b/sycl/include/CL/__spirv/spirv_ops.hpp @@ -358,7 +358,7 @@ __spirv_ImageSampleExplicitLod(SampledType, TempArgT, int, float); // of atomic min/max based on the type #define __SPIRV_ATOMIC_MINMAX(AS, Op) \ template \ - typename sycl::detail::enable_if_t< \ + typename std::enable_if_t< \ std::is_integral::value && std::is_signed::value, T> \ __spirv_Atomic##Op(AS T *Ptr, __spv::Scope::Flag Memory, \ __spv::MemorySemanticsMask::Flag Semantics, \ @@ -366,7 +366,7 @@ __spirv_ImageSampleExplicitLod(SampledType, TempArgT, int, float); return __spirv_AtomicS##Op(Ptr, Memory, Semantics, Value); \ } \ template \ - typename sycl::detail::enable_if_t< \ + typename std::enable_if_t< \ std::is_integral::value && !std::is_signed::value, T> \ __spirv_Atomic##Op(AS T *Ptr, __spv::Scope::Flag Memory, \ __spv::MemorySemanticsMask::Flag Semantics, \ @@ -374,7 +374,7 @@ __spirv_ImageSampleExplicitLod(SampledType, TempArgT, int, float); return __spirv_AtomicU##Op(Ptr, Memory, Semantics, Value); \ } \ template \ - typename sycl::detail::enable_if_t::value, T> \ + typename std::enable_if_t::value, T> \ __spirv_Atomic##Op(AS T *Ptr, __spv::Scope::Flag Memory, \ __spv::MemorySemanticsMask::Flag Semantics, \ T Value) { \ diff --git a/sycl/include/sycl/accessor.hpp b/sycl/include/sycl/accessor.hpp index 3f6cbaf429f78..51a4cb7998b58 100644 --- a/sycl/include/sycl/accessor.hpp +++ b/sycl/include/sycl/accessor.hpp @@ -338,24 +338,22 @@ class accessor_common { MIDs[0] = Index; } - template 1)>> + template 1)>> auto operator[](size_t Index) { MIDs[Dims - CurDims] = Index; return AccessorSubscript(MAccessor, MIDs); } template > + typename = std::enable_if_t> typename AccType::reference operator[](size_t Index) const { MIDs[Dims - CurDims] = Index; return MAccessor[MIDs]; } template - typename detail::enable_if_t> + typename std::enable_if_t> operator[](size_t Index) const { MIDs[Dims - CurDims] = Index; return MAccessor[MIDs]; @@ -740,7 +738,7 @@ class image_accessor // accessor(image &imageRef); template < typename AllocatorT, int Dims = Dimensions, - typename = detail::enable_if_t<(Dims > 0 && Dims <= 3) && IsHostImageAcc>> + typename = std::enable_if_t<(Dims > 0 && Dims <= 3) && IsHostImageAcc>> image_accessor(image &ImageRef, int ImageElementSize) #ifdef __SYCL_DEVICE_ONLY__ { @@ -766,9 +764,8 @@ class image_accessor // template // accessor(image &imageRef, // handler &commandGroupHandlerRef); - template < - typename AllocatorT, int Dims = Dimensions, - typename = detail::enable_if_t<(Dims > 0 && Dims <= 3) && IsImageAcc>> + template 0 && Dims <= 3) && IsImageAcc>> image_accessor(image &ImageRef, handler &CommandGroupHandlerRef, int ImageElementSize) #ifdef __SYCL_DEVICE_ONLY__ @@ -822,17 +819,17 @@ class image_accessor size_t get_count() const { return size(); } size_t size() const noexcept { return get_range().size(); } - template > + template > range<1> get_range() const { int Range = getRangeInternal(); return range<1>(Range); } - template > + template > range<2> get_range() const { int2 Range = getRangeInternal(); return range<2>(Range[0], Range[1]); } - template > + template > range<3> get_range() const { int3 Range = getRangeInternal(); return range<3>(Range[0], Range[1], Range[2]); @@ -843,7 +840,7 @@ class image_accessor size_t get_count() const { return size(); }; size_t size() const noexcept { return MImageCount; }; - template 0)>> + template 0)>> range get_range() const { return detail::convertToArrayOfN(getAccessRange()); } @@ -855,7 +852,7 @@ class image_accessor // || (accessTarget == access::target::host_image && ( accessMode == // access::mode::read || accessMode == access::mode::read_write)) template 0) && (IsValidCoordDataT::value) && (detail::is_genint::value) && ((IsImageAcc && IsImageAccessReadOnly) || @@ -875,7 +872,7 @@ class image_accessor // || (accessTarget == access::target::host_image && ( accessMode == // access::mode::read || accessMode == access::mode::read_write)) template 0) && (IsValidCoordDataT::value) && ((IsImageAcc && IsImageAccessReadOnly) || (IsHostImageAcc && IsImageAccessAnyRead))>> @@ -899,7 +896,7 @@ class image_accessor // access::mode::write || accessMode == access::mode::discard_write || // accessMode == access::mode::read_write)) template 0) && (detail::is_genint::value) && (IsValidCoordDataT::value) && ((IsImageAcc && IsImageAccessWriteOnly) || @@ -955,22 +952,22 @@ class __image_array_slice__ { : MBaseAcc(BaseAcc), MIdx(Idx) {} template 0) && (IsValidCoordDataT::value)>> DataT read(const CoordT &Coords) const { return MBaseAcc.read(getAdjustedCoords(Coords)); } template 0) && IsValidCoordDataT::value>> + typename = std::enable_if_t<(Dims > 0) && + IsValidCoordDataT::value>> DataT read(const CoordT &Coords, const sampler &Smpl) const { return MBaseAcc.read(getAdjustedCoords(Coords), Smpl); } template 0) && IsValidCoordDataT::value>> + typename = std::enable_if_t<(Dims > 0) && + IsValidCoordDataT::value>> void write(const CoordT &Coords, const DataT &Color) const { return MBaseAcc.write(getAdjustedCoords(Coords), Color); } @@ -980,12 +977,12 @@ class __image_array_slice__ { size_t get_count() const { return size(); } size_t size() const noexcept { return get_range().size(); } - template > + template > range<1> get_range() const { int2 Count = MBaseAcc.getRangeInternal(); return range<1>(Count.x()); } - template > + template > range<2> get_range() const { int3 Count = MBaseAcc.getRangeInternal(); return range<2>(Count.x(), Count.y()); @@ -1000,7 +997,7 @@ class __image_array_slice__ { } template > + typename = std::enable_if_t<(Dims == 1 || Dims == 2)>> range get_range() const { return detail::convertToArrayOfN(MBaseAcc.getAccessRange()); } @@ -1308,7 +1305,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : public: // implicit conversion between const / non-const types for read only accessors template && std::is_same_v, std::remove_const_t>>> @@ -1324,7 +1321,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : // implicit conversion from read_write T accessor to read only T (const) // accessor template , std::remove_const_t>>> @@ -1338,7 +1335,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : } template ::value && std::is_same::value && Dims == 0 && (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))> * = @@ -1371,7 +1368,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && std::is_same::value && Dims == 0 && (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))> * = @@ -1404,7 +1401,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : } template ::value && std::is_same::value && (Dims == 0) && (IsGlobalBuf || IsHostBuf || IsConstantBuf || IsHostTask)>> @@ -1436,7 +1433,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && std::is_same::value && (Dims == 0) && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1468,7 +1465,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : #endif template ::value && IsSameAsBuffer::value && (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>> @@ -1502,7 +1499,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>> @@ -1537,7 +1534,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && IsValidTag::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1551,7 +1548,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && IsValidTag::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1565,7 +1562,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : } template ::value && IsSameAsBuffer::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1598,7 +1595,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1632,7 +1629,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && IsValidTag::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1646,7 +1643,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && IsValidTag::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1661,7 +1658,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : } template ::value && IsSameAsBuffer::value && (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>> @@ -1673,7 +1670,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>> @@ -1686,7 +1683,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && IsValidTag::value && (IsGlobalBuf || IsConstantBuf)>> @@ -1700,7 +1697,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && IsValidTag::value && (IsGlobalBuf || IsConstantBuf)>> @@ -1715,7 +1712,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : } template ::value && IsSameAsBuffer::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1728,7 +1725,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1743,7 +1740,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && IsValidTag::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1759,7 +1756,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && IsValidTag::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1775,7 +1772,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : } template ::value && IsSameAsBuffer::value && (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>> @@ -1815,7 +1812,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>> @@ -1857,7 +1854,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && IsValidTag::value && (IsGlobalBuf || IsConstantBuf)>> @@ -1871,7 +1868,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && IsValidTag::value && (IsGlobalBuf || IsConstantBuf)>> @@ -1886,7 +1883,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : } template ::value && IsSameAsBuffer::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1927,7 +1924,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1969,7 +1966,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && IsValidTag::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -1985,7 +1982,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template ::value && IsSameAsBuffer::value && IsValidTag::value && (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>> @@ -2051,12 +2048,12 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : bool empty() const noexcept { return size() == 0; } - template 0)>> + template 0)>> range get_range() const { return detail::convertToArrayOfN(getAccessRange()); } - template 0)>> + template 0)>> id get_offset() const { static_assert( !(PropertyListT::template has_property< @@ -2066,54 +2063,54 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : } template > + typename = std::enable_if_t> operator reference() const { const size_t LinearIndex = getLinearIndex(id()); return *(getQualifiedPtr() + LinearIndex); } template > + typename = std::enable_if_t> const accessor &operator=(const value_type &Other) const { *getQualifiedPtr() = Other; return *this; } template > + typename = std::enable_if_t> const accessor &operator=(value_type &&Other) const { *getQualifiedPtr() = std::move(Other); return *this; } template 0) && (IsAccessAnyWrite || - IsAccessReadOnly)>> + typename = std::enable_if_t<(Dims > 0) && + (IsAccessAnyWrite || IsAccessReadOnly)>> reference operator[](id Index) const { const size_t LinearIndex = getLinearIndex(Index); return getQualifiedPtr()[LinearIndex]; } template - operator typename detail::enable_if_t + atomic #else - atomic + atomic #endif - >() const { + >() const { const size_t LinearIndex = getLinearIndex(id()); return atomic(multi_ptr( getQualifiedPtr() + LinearIndex)); } template - typename detail::enable_if_t<(Dims > 0) && AccessMode == access::mode::atomic, - atomic> + typename std::enable_if_t<(Dims > 0) && AccessMode == access::mode::atomic, + atomic> operator[](id Index) const { const size_t LinearIndex = getLinearIndex(Index); return atomic(multi_ptr( @@ -2121,20 +2118,20 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : } template - typename detail::enable_if_t> + typename std::enable_if_t> operator[](size_t Index) const { const size_t LinearIndex = getLinearIndex(id(Index)); return atomic(multi_ptr( getQualifiedPtr() + LinearIndex)); } - template 1)>> + template 1)>> auto operator[](size_t Index) const { return AccessorSubscript(*this, Index); } template > #if SYCL_LANGUAGE_VERSION >= 202001 @@ -2148,14 +2145,14 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : template < access::target AccessTarget_ = AccessTarget, - typename = detail::enable_if_t> + typename = std::enable_if_t> global_ptr get_pointer() const { return global_ptr(getPointerAdjusted()); } template > + typename = std::enable_if_t> constant_ptr get_pointer() const { return constant_ptr(getPointerAdjusted()); } @@ -2169,7 +2166,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : // code. This restriction is not listed in the core spec and will be added in // future versions. template - typename sycl::detail::enable_if_t< + typename std::enable_if_t< !ext::oneapi::is_compile_time_property::value, bool> has_property() const noexcept { #ifndef __SYCL_DEVICE_ONLY__ @@ -2183,7 +2180,7 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor : // code. This restriction is not listed in the core spec and will be added in // future versions. template ::value>> Property get_property() const { #ifndef __SYCL_DEVICE_ONLY__ @@ -2586,12 +2583,11 @@ class __SYCL_SPECIAL_CLASS local_accessor_base : using reference = DataT &; using const_reference = const DataT &; - template > + template > local_accessor_base(handler &, const detail::code_location CodeLoc = detail::code_location::current()) #ifdef __SYCL_DEVICE_ONLY__ - : impl(range{1}) { - } + : impl(range{1}){} #else : LocalAccessorBaseHost(range<3>{1, 1, 1}, AdjustedDim, sizeof(DataT)) { detail::constructorNotification(nullptr, LocalAccessorBaseHost::impl.get(), @@ -2600,10 +2596,10 @@ class __SYCL_SPECIAL_CLASS local_accessor_base : } #endif - template > - local_accessor_base( - handler &, const property_list &propList, - const detail::code_location CodeLoc = detail::code_location::current()) + template > + local_accessor_base(handler &, const property_list &propList, + const detail::code_location CodeLoc = + detail::code_location::current()) #ifdef __SYCL_DEVICE_ONLY__ : impl(range{1}) { (void)propList; @@ -2617,13 +2613,12 @@ class __SYCL_SPECIAL_CLASS local_accessor_base : } #endif - template 0)>> + template 0)>> local_accessor_base( range AllocationSize, handler &, const detail::code_location CodeLoc = detail::code_location::current()) #ifdef __SYCL_DEVICE_ONLY__ - : impl(AllocationSize) { - } + : impl(AllocationSize){} #else : LocalAccessorBaseHost(detail::convertToArrayOfN<3, 1>(AllocationSize), AdjustedDim, sizeof(DataT)) { @@ -2633,11 +2628,12 @@ class __SYCL_SPECIAL_CLASS local_accessor_base : } #endif - template 0)>> - local_accessor_base( - range AllocationSize, handler &, - const property_list &propList, - const detail::code_location CodeLoc = detail::code_location::current()) + template 0)>> + local_accessor_base(range AllocationSize, handler &, + const property_list &propList, + const detail::code_location CodeLoc = + detail::code_location::current()) #ifdef __SYCL_DEVICE_ONLY__ : impl(AllocationSize) { (void)propList; @@ -2657,32 +2653,32 @@ class __SYCL_SPECIAL_CLASS local_accessor_base : size_t get_count() const { return size(); } size_t size() const noexcept { return getSize().size(); } - template 0)>> + template 0)>> range get_range() const { return detail::convertToArrayOfN(getSize()); } template > + typename = std::enable_if_t> operator RefType() const { return *getQualifiedPtr(); } template 0) && IsAccessAnyWrite>> + typename = std::enable_if_t<(Dims > 0) && IsAccessAnyWrite>> RefType operator[](id Index) const { const size_t LinearIndex = getLinearIndex(Index); return getQualifiedPtr()[LinearIndex]; } template > + typename = std::enable_if_t> RefType operator[](size_t Index) const { return getQualifiedPtr()[Index]; } template - operator typename detail::enable_if_t< + operator typename std::enable_if_t< Dims == 0 && AccessMode == access::mode::atomic, atomic>() const { return atomic( @@ -2690,8 +2686,8 @@ class __SYCL_SPECIAL_CLASS local_accessor_base : } template - typename detail::enable_if_t<(Dims > 0) && AccessMode == access::mode::atomic, - atomic> + typename std::enable_if_t<(Dims > 0) && AccessMode == access::mode::atomic, + atomic> operator[](id Index) const { const size_t LinearIndex = getLinearIndex(Index); return atomic(multi_ptr( @@ -2699,14 +2695,14 @@ class __SYCL_SPECIAL_CLASS local_accessor_base : } template - typename detail::enable_if_t> + typename std::enable_if_t> operator[](size_t Index) const { return atomic(multi_ptr( getQualifiedPtr() + Index)); } - template 1)>> + template 1)>> typename AccessorCommonT::template AccessorSubscript< Dims - 1, local_accessor_base> @@ -2878,15 +2874,15 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(local_accessor) local_accessor #endif } - template && Dims == 0>> + template && Dims == 0>> const local_accessor &operator=(const value_type &Other) const { *local_acc::getQualifiedPtr() = Other; return *this; } - template && Dims == 0>> + template && Dims == 0>> const local_accessor &operator=(value_type &&Other) const { *local_acc::getQualifiedPtr() = std::move(Other); return *this; @@ -3120,7 +3116,7 @@ class __SYCL_EBO host_accessor // -------+---------+-------+----+----------+-------------- template ::value && Dims == 0>> host_accessor( buffer &BufferRef, @@ -3129,7 +3125,7 @@ class __SYCL_EBO host_accessor : AccessorT(BufferRef, PropertyList, CodeLoc) {} template ::value>> + typename = std::enable_if_t::value>> host_accessor( buffer &BufferRef, const property_list &PropertyList = {}, @@ -3137,7 +3133,7 @@ class __SYCL_EBO host_accessor : AccessorT(BufferRef, PropertyList, CodeLoc) {} template ::value>> + typename = std::enable_if_t::value>> host_accessor( buffer &BufferRef, mode_tag_t, const property_list &PropertyList = {}, @@ -3145,7 +3141,7 @@ class __SYCL_EBO host_accessor : host_accessor(BufferRef, PropertyList, CodeLoc) {} template ::value>> + typename = std::enable_if_t::value>> host_accessor( buffer &BufferRef, handler &CommandGroupHandler, const property_list &PropertyList = {}, @@ -3153,7 +3149,7 @@ class __SYCL_EBO host_accessor : AccessorT(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {} template ::value>> + typename = std::enable_if_t::value>> host_accessor( buffer &BufferRef, handler &CommandGroupHandler, mode_tag_t, const property_list &PropertyList = {}, @@ -3161,7 +3157,7 @@ class __SYCL_EBO host_accessor : host_accessor(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {} template ::value>> + typename = std::enable_if_t::value>> host_accessor( buffer &BufferRef, range AccessRange, const property_list &PropertyList = {}, @@ -3169,7 +3165,7 @@ class __SYCL_EBO host_accessor : AccessorT(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {} template ::value>> + typename = std::enable_if_t::value>> host_accessor( buffer &BufferRef, range AccessRange, mode_tag_t, const property_list &PropertyList = {}, @@ -3177,7 +3173,7 @@ class __SYCL_EBO host_accessor : host_accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {} template ::value>> + typename = std::enable_if_t::value>> host_accessor( buffer &BufferRef, handler &CommandGroupHandler, range AccessRange, const property_list &PropertyList = {}, @@ -3186,7 +3182,7 @@ class __SYCL_EBO host_accessor CodeLoc) {} template ::value>> + typename = std::enable_if_t::value>> host_accessor( buffer &BufferRef, handler &CommandGroupHandler, range AccessRange, mode_tag_t, @@ -3196,7 +3192,7 @@ class __SYCL_EBO host_accessor PropertyList, CodeLoc) {} template ::value>> + typename = std::enable_if_t::value>> host_accessor( buffer &BufferRef, range AccessRange, id AccessOffset, const property_list &PropertyList = {}, @@ -3205,7 +3201,7 @@ class __SYCL_EBO host_accessor } template ::value>> + typename = std::enable_if_t::value>> host_accessor( buffer &BufferRef, range AccessRange, id AccessOffset, mode_tag_t, @@ -3215,7 +3211,7 @@ class __SYCL_EBO host_accessor CodeLoc) {} template ::value>> + typename = std::enable_if_t::value>> host_accessor( buffer &BufferRef, handler &CommandGroupHandler, range AccessRange, id AccessOffset, @@ -3225,7 +3221,7 @@ class __SYCL_EBO host_accessor PropertyList, CodeLoc) {} template ::value>> + typename = std::enable_if_t::value>> host_accessor( buffer &BufferRef, handler &CommandGroupHandler, range AccessRange, id AccessOffset, @@ -3235,8 +3231,8 @@ class __SYCL_EBO host_accessor PropertyList, CodeLoc) {} template > + typename = std::enable_if_t> const host_accessor & operator=(const typename AccessorT::value_type &Other) const { *AccessorT::getQualifiedPtr() = Other; @@ -3244,8 +3240,8 @@ class __SYCL_EBO host_accessor } template > + typename = std::enable_if_t> const host_accessor &operator=(typename AccessorT::value_type &&Other) const { *AccessorT::getQualifiedPtr() = std::move(Other); return *this; diff --git a/sycl/include/sycl/atomic.hpp b/sycl/include/sycl/atomic.hpp index 697907dc0c45b..beb9174941e30 100644 --- a/sycl/include/sycl/atomic.hpp +++ b/sycl/include/sycl/atomic.hpp @@ -210,7 +210,7 @@ class __SYCL2020_DEPRECATED( #ifdef __ENABLE_USM_ADDR_SPACE__ // Create atomic in global_space with one from ext_intel_global_device_space template > atomic(const atomic @@ -219,7 +219,7 @@ class __SYCL2020_DEPRECATED( } template > atomic( @@ -235,13 +235,13 @@ class __SYCL2020_DEPRECATED( #ifdef __SYCL_DEVICE_ONLY__ template - detail::enable_if_t::value, T> + std::enable_if_t::value, T> load(memory_order Order = memory_order::relaxed) const { return __spirv_AtomicLoad(Ptr, SpirvScope, detail::getSPIRVMemorySemanticsMask(Order)); } template - detail::enable_if_t::value, T> + std::enable_if_t::value, T> load(memory_order Order = memory_order::relaxed) const { auto *TmpPtr = reinterpret_cast::pointer>(Ptr); diff --git a/sycl/include/sycl/atomic_ref.hpp b/sycl/include/sycl/atomic_ref.hpp index d3297b2708e38..b33a45f0d6be7 100644 --- a/sycl/include/sycl/atomic_ref.hpp +++ b/sycl/include/sycl/atomic_ref.hpp @@ -50,9 +50,9 @@ template struct IsValidAtomicRefAddressSpace { // DefaultOrder parameter is limited to read-modify-write orders template -using IsValidDefaultOrder = bool_constant; +using IsValidDefaultOrder = std::bool_constant; template struct memory_order_traits; @@ -90,7 +90,7 @@ inline constexpr memory_order getLoadOrder(memory_order order) { template struct bit_equal; template -struct bit_equal::value>> { +struct bit_equal::value>> { bool operator()(const T &lhs, const T &rhs) { return lhs == rhs; } }; @@ -275,7 +275,7 @@ template class atomic_ref_impl::value>> + typename std::enable_if_t::value>> : public atomic_ref_base { public: @@ -423,7 +423,7 @@ template class atomic_ref_impl< T, IsAspectAtomic64AttrUsed, DefaultOrder, DefaultScope, AddressSpace, - typename detail::enable_if_t::value>> + typename std::enable_if_t::value>> : public atomic_ref_base { public: @@ -536,7 +536,7 @@ class atomic_ref_impl< class [[__sycl_detail__::__uses_aspects__(aspect::atomic64)]] atomic_ref_impl< #endif T, /*IsAspectAtomic64AttrUsed = */ true, DefaultOrder, DefaultScope, - AddressSpace, typename detail::enable_if_t::value>> + AddressSpace, typename std::enable_if_t::value>> : public atomic_ref_impl { public: @@ -556,8 +556,7 @@ class atomic_ref_impl< class [[__sycl_detail__::__uses_aspects__(aspect::atomic64)]] atomic_ref_impl< #endif T, /*IsAspectAtomic64AttrUsed = */ true, DefaultOrder, DefaultScope, - AddressSpace, - typename detail::enable_if_t::value>> + AddressSpace, typename std::enable_if_t::value>> : public atomic_ref_impl { public: diff --git a/sycl/include/sycl/backend/opencl.hpp b/sycl/include/sycl/backend/opencl.hpp index f60dddd4b1d8d..bbf06d3a1eddc 100644 --- a/sycl/include/sycl/backend/opencl.hpp +++ b/sycl/include/sycl/backend/opencl.hpp @@ -33,7 +33,7 @@ __SYCL_EXPORT bool has_extension(const sycl::device &SyclDevice, const std::string &Extension); // Construction of SYCL platform. -template ::value> * = nullptr> __SYCL_DEPRECATED("Use SYCL 2020 sycl::make_platform free function") T make(typename detail::interop::type Interop) { @@ -41,24 +41,24 @@ T make(typename detail::interop::type Interop) { } // Construction of SYCL device. -template ::value> * = nullptr> +template ::value> * = nullptr> __SYCL_DEPRECATED("Use SYCL 2020 sycl::make_device free function") T make(typename detail::interop::type Interop) { return make_device(detail::pi::cast(Interop)); } // Construction of SYCL context. -template ::value> * = nullptr> +template ::value> + * = nullptr> __SYCL_DEPRECATED("Use SYCL 2020 sycl::make_context free function") T make(typename detail::interop::type Interop) { return make_context(detail::pi::cast(Interop)); } // Construction of SYCL queue. -template ::value> * = nullptr> +template ::value> * = nullptr> __SYCL_DEPRECATED("Use SYCL 2020 sycl::make_queue free function") T make(const context &Context, typename detail::interop::type Interop) { diff --git a/sycl/include/sycl/buffer.hpp b/sycl/include/sycl/buffer.hpp index cfb19822528d5..955e108f64880 100644 --- a/sycl/include/sycl/buffer.hpp +++ b/sycl/include/sycl/buffer.hpp @@ -140,8 +140,8 @@ class __SYCL_EXPORT buffer_plain { /// \ingroup sycl_api template >, - typename __Enabled = typename detail::enable_if_t<(dimensions > 0) && - (dimensions <= 3)>> + typename __Enabled = + typename std::enable_if_t<(dimensions > 0) && (dimensions <= 3)>> class buffer : public detail::buffer_plain, public detail::OwnerLessBase> { // TODO check is_device_copyable::value after converting sycl::vec into a @@ -155,21 +155,21 @@ class buffer : public detail::buffer_plain, using const_reference = const value_type &; using allocator_type = AllocatorT; template - using EnableIfOneDimension = typename detail::enable_if_t<1 == dims>; + using EnableIfOneDimension = typename std::enable_if_t<1 == dims>; // using same requirement for contiguous container as std::span template using EnableIfContiguous = - detail::void_t().data())> (*)[], - const T (*)[]>::value>, - decltype(std::declval().size())>; + std::void_t().data())> (*)[], + const T (*)[]>::value>, + decltype(std::declval().size())>; template - using EnableIfItInputIterator = detail::enable_if_t< + using EnableIfItInputIterator = std::enable_if_t< std::is_convertible::iterator_category, std::input_iterator_tag>::value>; template - using EnableIfSameNonConstIterators = typename detail::enable_if_t< + using EnableIfSameNonConstIterators = typename std::enable_if_t< std::is_same::value && !std::is_const::value, ItA>; std::array rangeToArray(range<3> &r) { return {r[0], r[1], r[2]}; } @@ -344,9 +344,9 @@ class buffer : public detail::buffer_plain, using IteratorValueType = detail::iterator_value_type_t; using IteratorNonConstValueType = - detail::remove_const_t; + std::remove_const_t; using IteratorPointerToNonConstValueType = - detail::add_pointer_t; + std::add_pointer_t; std::copy(first, last, static_cast(ToPtr)); }, @@ -377,9 +377,9 @@ class buffer : public detail::buffer_plain, using IteratorValueType = detail::iterator_value_type_t; using IteratorNonConstValueType = - detail::remove_const_t; + std::remove_const_t; using IteratorPointerToNonConstValueType = - detail::add_pointer_t; + std::add_pointer_t; std::copy(first, last, static_cast(ToPtr)); }, @@ -588,7 +588,7 @@ class buffer : public detail::buffer_plain, } template