From d0d2a8651663eebce9397ed390d73dcaf9d6c01e Mon Sep 17 00:00:00 2001 From: Alexander Batashev Date: Fri, 7 Aug 2020 10:50:39 +0300 Subject: [PATCH 01/19] [SYCL] Implement SYCL_ONEAPI_accessor_properties extension Signed-off-by: Alexander Batashev --- sycl/include/CL/sycl/accessor.hpp | 448 +++++++++++++++++- .../CL/sycl/accessor_property_list.hpp | 176 +++++++ sycl/include/CL/sycl/buffer.hpp | 29 +- sycl/include/CL/sycl/detail/accessor_impl.hpp | 4 + sycl/include/CL/sycl/detail/buffer_impl.hpp | 3 +- sycl/include/CL/sycl/detail/image_impl.hpp | 3 +- .../CL/sycl/detail/property_list_base.hpp | 114 +++++ sycl/include/CL/sycl/handler.hpp | 8 +- sycl/include/CL/sycl/image.hpp | 14 +- sycl/include/CL/sycl/interop_handler.hpp | 3 +- sycl/include/CL/sycl/multi_ptr.hpp | 88 ++-- .../sycl/properties/accessor_properties.hpp | 84 ++++ sycl/include/CL/sycl/property_list.hpp | 85 +--- sycl/include/CL/sycl/types.hpp | 18 +- sycl/test/abi/layout_accessors.cpp | 10 +- .../accessor/accessor_property_list.cpp | 107 +++++ 16 files changed, 1018 insertions(+), 176 deletions(-) create mode 100644 sycl/include/CL/sycl/accessor_property_list.hpp create mode 100644 sycl/include/CL/sycl/detail/property_list_base.hpp create mode 100644 sycl/test/basic_tests/accessor/accessor_property_list.cpp diff --git a/sycl/include/CL/sycl/accessor.hpp b/sycl/include/CL/sycl/accessor.hpp index dd4f7fc09be01..8c101a48aea24 100755 --- a/sycl/include/CL/sycl/accessor.hpp +++ b/sycl/include/CL/sycl/accessor.hpp @@ -9,6 +9,7 @@ #pragma once #include +#include #include #include #include @@ -26,6 +27,8 @@ #include #include +#include + /// \file accessor.hpp /// The file contains implementations of accessor class. /// @@ -214,10 +217,25 @@ namespace sycl { template + access::placeholder IsPlaceholder = access::placeholder::false_t, + typename PropertyListT = property_list> class accessor; namespace detail { +template +using IsPropertyListT = typename std::is_base_of; + +template +using IsRunTimePropertyListT = typename std::is_same; + +template struct IsOneapiPropertyListT { + constexpr static bool value = false; +}; + +template +struct IsOneapiPropertyListT> { + constexpr static bool value = true; +}; // The function extends or truncates number of dimensions of objects of id // or ranges classes. When extending the new values are filled with @@ -732,7 +750,8 @@ class __image_array_slice__ { /// /// \ingroup sycl_api_acc template + access::target AccessTarget, access::placeholder IsPlaceholder, + typename PropertyListT> class accessor : #ifndef __SYCL_DEVICE_ONLY__ public detail::AccessorBaseHost, @@ -751,6 +770,8 @@ class accessor : AccessMode == access::mode::read), "Access mode can be only read for constant buffers"); + static_assert(detail::IsPropertyListT::value, "PropertyListT must be property_list or accessor_property_list"); + using AccessorCommonT = detail::accessor_common; @@ -791,10 +812,10 @@ class accessor : return std::is_same::value && (Dims > 0) && (Dims == Dimensions); } - static access::mode getAdjustedMode(const property_list &PropertyList) { + static access::mode getAdjustedMode(const PropertyListT &PropertyList) { access::mode AdjustedMode = AccessMode; - if (PropertyList.has_property()) { + if (PropertyList.template has_property()) { if (AdjustedMode == access::mode::write) { AdjustedMode = access::mode::discard_write; } else if (AdjustedMode == access::mode::read_write) { @@ -864,6 +885,14 @@ class accessor : #endif // __SYCL_EXPLICIT_SIMD__ ConcreteASPtrType getQualifiedPtr() const { return MData; } + template + friend class accessor; + +#ifndef __SYCL_DEVICE_ONLY__ + using AccessorBaseHost::impl; +#endif + public: // Default constructor for objects later initialized with __init member. accessor() @@ -918,6 +947,7 @@ class accessor : public: template ::value && std::is_same::value && Dims == 0 && ((!IsPlaceH && IsHostBuf) || (IsPlaceH && (IsGlobalBuf || IsConstantBuf)))> * = nullptr> @@ -939,8 +969,35 @@ class accessor : #endif } + template ::value && + std::is_same::value && Dims == 0 && + ((!IsPlaceH && IsHostBuf) || + (IsPlaceH && (IsGlobalBuf || IsConstantBuf)))> * = nullptr> + accessor(buffer &BufferRef, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) +#ifdef __SYCL_DEVICE_ONLY__ + : impl(id(), range<1>{1}, BufferRef.get_range()) { + (void)PropertyList; +#else + : AccessorBaseHost( + /*Offset=*/{0, 0, 0}, detail::convertToArrayOfN<3, 1>(range<1>{1}), + detail::convertToArrayOfN<3, 1>(BufferRef.get_range()), + getAdjustedMode(PropertyList), + detail::getSyclObjImpl(BufferRef).get(), AdjustedDim, sizeof(DataT), + BufferRef.OffsetInBytes, BufferRef.IsSubBuffer) { + checkDeviceAccessorBufferSize(BufferRef.get_count()); + if (!IsPlaceH) + addHostAccessorAndWait(AccessorBaseHost::impl.get()); +#endif + } + template ::value && std::is_same::value && (Dims == 0) && (!IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf))>> accessor(buffer &BufferRef, handler &CommandGroupHandler, @@ -963,10 +1020,37 @@ class accessor : #endif template () && - ((!IsPlaceH && IsHostBuf) || - (IsPlaceH && - (IsGlobalBuf || IsConstantBuf)))>> + typename... PropTypes, + typename = typename detail::enable_if_t< + detail::IsOneapiPropertyListT::value && + std::is_same::value && (Dims == 0) && + (!IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf))>> + accessor(buffer &BufferRef, handler &CommandGroupHandler, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) +#ifdef __SYCL_DEVICE_ONLY__ + : impl(id(), range<1>{1}, BufferRef.get_range()) { + (void)CommandGroupHandler; + (void)PropertyList; + } +#else + : AccessorBaseHost( + /*Offset=*/{0, 0, 0}, detail::convertToArrayOfN<3, 1>(range<1>{1}), + detail::convertToArrayOfN<3, 1>(BufferRef.get_range()), + getAdjustedMode(PropertyList), + detail::getSyclObjImpl(BufferRef).get(), Dimensions, sizeof(DataT), + BufferRef.OffsetInBytes, BufferRef.IsSubBuffer) { + checkDeviceAccessorBufferSize(BufferRef.get_count()); + detail::associateWithHandler(CommandGroupHandler, this, AccessTarget); + } +#endif + + template ::value && + IsSameAsBuffer() && + ((!IsPlaceH && IsHostBuf) || + (IsPlaceH && (IsGlobalBuf || IsConstantBuf)))>> accessor(buffer &BufferRef, const property_list &PropertyList = {}) #ifdef __SYCL_DEVICE_ONLY__ @@ -987,21 +1071,61 @@ class accessor : } #endif + template ::value && + IsSameAsBuffer() && + ((!IsPlaceH && IsHostBuf) || + (IsPlaceH && (IsGlobalBuf || IsConstantBuf)))>> + accessor(buffer &BufferRef, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) +#ifdef __SYCL_DEVICE_ONLY__ + : impl(id(), BufferRef.get_range(), BufferRef.get_range()) { + (void)PropertyList; + } +#else + : AccessorBaseHost( + /*Offset=*/{0, 0, 0}, + detail::convertToArrayOfN<3, 1>(BufferRef.get_range()), + detail::convertToArrayOfN<3, 1>(BufferRef.get_range()), + getAdjustedMode(PropertyList), + detail::getSyclObjImpl(BufferRef).get(), Dimensions, sizeof(DataT), + BufferRef.OffsetInBytes, BufferRef.IsSubBuffer) { + checkDeviceAccessorBufferSize(BufferRef.get_count()); + if (!IsPlaceH) + addHostAccessorAndWait(AccessorBaseHost::impl.get()); + } +#endif + #if __cplusplus > 201402L template ::value && IsSameAsBuffer() && IsValidTag() && IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf)>> accessor(buffer &BufferRef, TagT, const property_list &PropertyList = {}) : accessor(BufferRef, PropertyList) {} + template ::value && + IsSameAsBuffer() && IsValidTag() && IsPlaceH && + (IsGlobalBuf || IsConstantBuf || IsHostBuf)>> + accessor(buffer &BufferRef, TagT, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) + : accessor(BufferRef, PropertyList) {} #endif template ::value && IsSameAsBuffer() && (!IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf))>> accessor(buffer &BufferRef, handler &CommandGroupHandler, @@ -1024,45 +1148,112 @@ class accessor : } #endif + template ::value && + IsSameAsBuffer() && + (!IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf))>> + accessor(buffer &BufferRef, handler &CommandGroupHandler, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) +#ifdef __SYCL_DEVICE_ONLY__ + : impl(id(), BufferRef.get_range(), BufferRef.get_range()) { + (void)CommandGroupHandler; + (void)PropertyList; + } +#else + : AccessorBaseHost( + /*Offset=*/{0, 0, 0}, + detail::convertToArrayOfN<3, 1>(BufferRef.get_range()), + detail::convertToArrayOfN<3, 1>(BufferRef.get_range()), + getAdjustedMode(PropertyList), + detail::getSyclObjImpl(BufferRef).get(), Dimensions, sizeof(DataT), + BufferRef.OffsetInBytes, BufferRef.IsSubBuffer) { + checkDeviceAccessorBufferSize(BufferRef.get_count()); + detail::associateWithHandler(CommandGroupHandler, this, AccessTarget); + } +#endif + #if __cplusplus > 201402L template ::value && IsSameAsBuffer() && IsValidTag() && !IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf)>> accessor(buffer &BufferRef, handler &CommandGroupHandler, TagT, const property_list &PropertyList = {}) : accessor(BufferRef, CommandGroupHandler, PropertyList) {} + template ::value && + IsSameAsBuffer() && IsValidTag() && !IsPlaceH && + (IsGlobalBuf || IsConstantBuf || IsHostBuf)>> + accessor(buffer &BufferRef, handler &CommandGroupHandler, + TagT, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) + : accessor(BufferRef, CommandGroupHandler, PropertyList) {} + #endif template () && - ((!IsPlaceH && IsHostBuf) || - (IsPlaceH && - (IsGlobalBuf || IsConstantBuf)))>> + typename = detail::enable_if_t< + detail::IsRunTimePropertyListT::value && + IsSameAsBuffer() && + ((!IsPlaceH && IsHostBuf) || + (IsPlaceH && (IsGlobalBuf || IsConstantBuf)))>> accessor(buffer &BufferRef, range AccessRange, const property_list &PropertyList = {}) : accessor(BufferRef, AccessRange, {}, PropertyList) {} + template ::value && + IsSameAsBuffer() && + ((!IsPlaceH && IsHostBuf) || + (IsPlaceH && (IsGlobalBuf || IsConstantBuf)))>> + accessor(buffer &BufferRef, + range AccessRange, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) + : accessor(BufferRef, AccessRange, {}, PropertyList) {} + #if __cplusplus > 201402L template () && - IsValidTag() && IsPlaceH && - (IsGlobalBuf || IsConstantBuf)>> + typename = detail::enable_if_t< + detail::IsRunTimePropertyListT::value && + IsSameAsBuffer() && IsValidTag() && IsPlaceH && + (IsGlobalBuf || IsConstantBuf)>> accessor(buffer &BufferRef, range AccessRange, TagT, const property_list &PropertyList = {}) : accessor(BufferRef, AccessRange, {}, PropertyList) {} + template ::value && + IsSameAsBuffer() && IsValidTag() && IsPlaceH && + (IsGlobalBuf || IsConstantBuf)>> + accessor(buffer &BufferRef, + range AccessRange, TagT, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) + : accessor(BufferRef, AccessRange, {}, PropertyList) {} #endif template ::value && IsSameAsBuffer() && (!IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf))>> accessor(buffer &BufferRef, handler &CommandGroupHandler, @@ -1071,11 +1262,25 @@ class accessor : : accessor(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList) {} + template ::value && + IsSameAsBuffer() && + (!IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf))>> + accessor(buffer &BufferRef, handler &CommandGroupHandler, + range AccessRange, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) + : accessor(BufferRef, CommandGroupHandler, AccessRange, {}, + PropertyList) {} + #if __cplusplus > 201402L template ::value && IsSameAsBuffer() && IsValidTag() && !IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf)>> accessor(buffer &BufferRef, handler &CommandGroupHandler, @@ -1084,13 +1289,26 @@ class accessor : : accessor(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList) {} + template ::value && + IsSameAsBuffer() && IsValidTag() && !IsPlaceH && + (IsGlobalBuf || IsConstantBuf || IsHostBuf)>> + accessor(buffer &BufferRef, handler &CommandGroupHandler, + range AccessRange, TagT, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) + : accessor(BufferRef, CommandGroupHandler, AccessRange, {}, + PropertyList) {} #endif template () && - ((!IsPlaceH && IsHostBuf) || - (IsPlaceH && - (IsGlobalBuf || IsConstantBuf)))>> + typename = detail::enable_if_t< + detail::IsRunTimePropertyListT::value && + IsSameAsBuffer() && + ((!IsPlaceH && IsHostBuf) || + (IsPlaceH && (IsGlobalBuf || IsConstantBuf)))>> accessor(buffer &BufferRef, range AccessRange, id AccessOffset, const property_list &PropertyList = {}) @@ -1112,22 +1330,64 @@ class accessor : } #endif + template ::value && + IsSameAsBuffer() && + ((!IsPlaceH && IsHostBuf) || + (IsPlaceH && (IsGlobalBuf || IsConstantBuf)))>> + accessor(buffer &BufferRef, + range AccessRange, id AccessOffset, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) +#ifdef __SYCL_DEVICE_ONLY__ + : impl(AccessOffset, AccessRange, BufferRef.get_range()) { + (void)PropertyList; + } +#else + : AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset), + detail::convertToArrayOfN<3, 1>(AccessRange), + detail::convertToArrayOfN<3, 1>(BufferRef.get_range()), + getAdjustedMode(PropertyList), + detail::getSyclObjImpl(BufferRef).get(), Dimensions, + sizeof(DataT), BufferRef.OffsetInBytes, + BufferRef.IsSubBuffer) { + checkDeviceAccessorBufferSize(BufferRef.get_count()); + if (!IsPlaceH) + addHostAccessorAndWait(AccessorBaseHost::impl.get()); + } +#endif + #if __cplusplus > 201402L template () && - IsValidTag() && IsPlaceH && - (IsGlobalBuf || IsConstantBuf)>> + typename = detail::enable_if_t< + detail::IsRunTimePropertyListT::value && + IsSameAsBuffer() && IsValidTag() && IsPlaceH && + (IsGlobalBuf || IsConstantBuf)>> accessor(buffer &BufferRef, range AccessRange, id AccessOffset, TagT, const property_list &PropertyList = {}) : accessor(BufferRef, AccessRange, AccessOffset, PropertyList) {} + template ::value && + IsSameAsBuffer() && IsValidTag() && IsPlaceH && + (IsGlobalBuf || IsConstantBuf)>> + accessor(buffer &BufferRef, + range AccessRange, id AccessOffset, TagT, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) + : accessor(BufferRef, AccessRange, AccessOffset, PropertyList) {} #endif template ::value && IsSameAsBuffer() && (!IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf))>> accessor(buffer &BufferRef, handler &CommandGroupHandler, @@ -1151,11 +1411,40 @@ class accessor : } #endif + template ::value && + IsSameAsBuffer() && + (!IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf))>> + accessor(buffer &BufferRef, handler &CommandGroupHandler, + range AccessRange, id AccessOffset, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) +#ifdef __SYCL_DEVICE_ONLY__ + : impl(AccessOffset, AccessRange, BufferRef.get_range()) { + (void)CommandGroupHandler; + (void)PropertyList; + } +#else + : AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset), + detail::convertToArrayOfN<3, 1>(AccessRange), + detail::convertToArrayOfN<3, 1>(BufferRef.get_range()), + getAdjustedMode(PropertyList), + detail::getSyclObjImpl(BufferRef).get(), Dimensions, + sizeof(DataT), BufferRef.OffsetInBytes, + BufferRef.IsSubBuffer) { + checkDeviceAccessorBufferSize(BufferRef.get_count()); + detail::associateWithHandler(CommandGroupHandler, this, AccessTarget); + } +#endif + #if __cplusplus > 201402L template ::value && IsSameAsBuffer() && IsValidTag() && !IsPlaceH && (IsGlobalBuf || IsConstantBuf || IsHostBuf)>> accessor(buffer &BufferRef, handler &CommandGroupHandler, @@ -1164,7 +1453,35 @@ class accessor : : accessor(BufferRef, CommandGroupHandler, AccessRange, AccessOffset, PropertyList) {} + template ::value && + IsSameAsBuffer() && IsValidTag() && !IsPlaceH && + (IsGlobalBuf || IsConstantBuf || IsHostBuf)>> + accessor(buffer &BufferRef, handler &CommandGroupHandler, + range AccessRange, id AccessOffset, TagT, + const ext::ONEAPI::accessor_property_list + &PropertyList = {}) + : accessor(BufferRef, CommandGroupHandler, AccessRange, AccessOffset, + PropertyList) {} +#endif + + template + accessor( + const accessor> &Other) +#ifdef __SYCL_DEVICE_ONLY__ + : impl(Other.impl) +#else + : detail::AccessorBaseHost(Other) #endif + { + static_assert(detail::IsOneapiPropertyListT::value, + "Conversion is only available for accessor_property_list"); + static_assert(PropertyListT::template areSameCxProperties(), + "Compile-time-constant properties must be the same"); + } constexpr bool is_placeholder() const { return IsPlaceH; } @@ -1287,12 +1604,29 @@ accessor(buffer) ->accessor; +template +accessor(buffer, + const ext::ONEAPI::accessor_property_list &) + ->accessor>; + template accessor(buffer, Type1) ->accessor(), detail::deduceAccessTarget(target::global_buffer), access::placeholder::true_t>; +template +accessor(buffer, Type1, + const ext::ONEAPI::accessor_property_list &) + ->accessor(), + detail::deduceAccessTarget(target::global_buffer), + access::placeholder::true_t, + ext::ONEAPI::accessor_property_list>; + template accessor(buffer, Type1, Type2) @@ -1300,6 +1634,15 @@ accessor(buffer, Type1, Type2) detail::deduceAccessTarget(target::global_buffer), access::placeholder::true_t>; +template +accessor(buffer, Type1, Type2, + const ext::ONEAPI::accessor_property_list &) + ->accessor(), + detail::deduceAccessTarget(target::global_buffer), + access::placeholder::true_t, + ext::ONEAPI::accessor_property_list>; + template accessor(buffer, Type1, Type2, Type3) @@ -1307,6 +1650,15 @@ accessor(buffer, Type1, Type2, Type3) detail::deduceAccessTarget(target::global_buffer), access::placeholder::true_t>; +template +accessor(buffer, Type1, Type2, Type3, + const ext::ONEAPI::accessor_property_list &) + ->accessor(), + detail::deduceAccessTarget(target::global_buffer), + access::placeholder::true_t, + ext::ONEAPI::accessor_property_list>; + template accessor(buffer, Type1, Type2, Type3, Type4) @@ -1314,17 +1666,43 @@ accessor(buffer, Type1, Type2, Type3, Type4) detail::deduceAccessTarget(target::global_buffer), access::placeholder::true_t>; +template +accessor(buffer, Type1, Type2, Type3, Type4, + const ext::ONEAPI::accessor_property_list &) + ->accessor(), + detail::deduceAccessTarget(target::global_buffer), + access::placeholder::true_t, + ext::ONEAPI::accessor_property_list>; + template accessor(buffer, handler) ->accessor; +template +accessor(buffer, handler, + const ext::ONEAPI::accessor_property_list &) + ->accessor>; + template accessor(buffer, handler, Type1) ->accessor(), detail::deduceAccessTarget(target::global_buffer), access::placeholder::false_t>; +template +accessor(buffer, handler, Type1, + const ext::ONEAPI::accessor_property_list &) + ->accessor(), + detail::deduceAccessTarget(target::global_buffer), + access::placeholder::false_t, + ext::ONEAPI::accessor_property_list>; + template accessor(buffer, handler, Type1, Type2) @@ -1332,6 +1710,15 @@ accessor(buffer, handler, Type1, Type2) detail::deduceAccessTarget(target::global_buffer), access::placeholder::false_t>; +template +accessor(buffer, handler, Type1, Type2, + const ext::ONEAPI::accessor_property_list &) + ->accessor(), + detail::deduceAccessTarget(target::global_buffer), + access::placeholder::false_t, + ext::ONEAPI::accessor_property_list>; + template accessor(buffer, handler, Type1, Type2, Type3) @@ -1339,6 +1726,15 @@ accessor(buffer, handler, Type1, Type2, Type3) detail::deduceAccessTarget(target::global_buffer), access::placeholder::false_t>; +template +accessor(buffer, handler, Type1, Type2, Type3, + const ext::ONEAPI::accessor_property_list &) + ->accessor(), + detail::deduceAccessTarget(target::global_buffer), + access::placeholder::false_t, + ext::ONEAPI::accessor_property_list>; + template accessor(buffer, handler, Type1, Type2, Type3, @@ -1347,6 +1743,14 @@ accessor(buffer, handler, Type1, Type2, Type3, detail::deduceAccessTarget(target::global_buffer), access::placeholder::false_t>; +template +accessor(buffer, handler, Type1, Type2, Type3, + Type4, const ext::ONEAPI::accessor_property_list &) + ->accessor(), + detail::deduceAccessTarget(target::global_buffer), + access::placeholder::false_t, + ext::ONEAPI::accessor_property_list>; #endif /// Local accessor diff --git a/sycl/include/CL/sycl/accessor_property_list.hpp b/sycl/include/CL/sycl/accessor_property_list.hpp new file mode 100644 index 0000000000000..84b366ed7a2c0 --- /dev/null +++ b/sycl/include/CL/sycl/accessor_property_list.hpp @@ -0,0 +1,176 @@ +//==----- accessor_property_list.hpp --- SYCL accessor property list -------==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include +#include +#include +#include + +#include + +__SYCL_INLINE_NAMESPACE(cl) { +namespace sycl { +namespace detail {} // namespace detail +namespace ext { +namespace ONEAPI { + +template struct is_property : std::false_type {}; + +template struct is_compile_time_property : std::false_type {}; + +/// Objects of the accessor_property_list class are containers for the SYCL +/// properties. +/// +/// Unlike \c property_list, accessor_property_list can take +/// compile-time-constant properties. +/// +/// \sa accessor +/// \sa property_list +/// +/// \ingroup sycl_api +template +class accessor_property_list : protected detail::PropertyListBase { + // These structures check if compile-time-constant property is present in + // list. For runtime properties this check is always true. + template struct AreSameTemplate : std::is_same {}; + template