@@ -1011,7 +1011,7 @@ class __SYCL_SPECIAL_CLASS accessor :
1011
1011
detail::convertToArrayOfN<3 , 1 >(BufferRef.get_range ()),
1012
1012
getAdjustedMode (PropertyList),
1013
1013
detail::getSyclObjImpl (BufferRef).get (), AdjustedDim, sizeof (DataT),
1014
- BufferRef.OffsetInBytes , BufferRef.IsSubBuffer ) {
1014
+ BufferRef.OffsetInBytes , BufferRef.IsSubBuffer , PropertyList ) {
1015
1015
preScreenAccessor (BufferRef.size (), PropertyList);
1016
1016
if (!IsPlaceH)
1017
1017
addHostAccessorAndWait (AccessorBaseHost::impl.get ());
@@ -1042,7 +1042,7 @@ class __SYCL_SPECIAL_CLASS accessor :
1042
1042
detail::convertToArrayOfN<3 , 1 >(BufferRef.get_range ()),
1043
1043
getAdjustedMode (PropertyList),
1044
1044
detail::getSyclObjImpl (BufferRef).get (), AdjustedDim, sizeof (DataT),
1045
- BufferRef.OffsetInBytes , BufferRef.IsSubBuffer ) {
1045
+ BufferRef.OffsetInBytes , BufferRef.IsSubBuffer , PropertyList ) {
1046
1046
preScreenAccessor (BufferRef.size (), PropertyList);
1047
1047
if (!IsPlaceH)
1048
1048
addHostAccessorAndWait (AccessorBaseHost::impl.get ());
@@ -1072,7 +1072,7 @@ class __SYCL_SPECIAL_CLASS accessor :
1072
1072
detail::convertToArrayOfN<3 , 1 >(BufferRef.get_range ()),
1073
1073
getAdjustedMode (PropertyList),
1074
1074
detail::getSyclObjImpl (BufferRef).get (), Dimensions, sizeof (DataT),
1075
- BufferRef.OffsetInBytes , BufferRef.IsSubBuffer ) {
1075
+ BufferRef.OffsetInBytes , BufferRef.IsSubBuffer , PropertyList ) {
1076
1076
preScreenAccessor (BufferRef.size (), PropertyList);
1077
1077
detail::associateWithHandler (CommandGroupHandler, this , AccessTarget);
1078
1078
detail::constructorNotification (detail::getSyclObjImpl (BufferRef).get (),
@@ -1103,7 +1103,7 @@ class __SYCL_SPECIAL_CLASS accessor :
1103
1103
detail::convertToArrayOfN<3 , 1 >(BufferRef.get_range ()),
1104
1104
getAdjustedMode (PropertyList),
1105
1105
detail::getSyclObjImpl (BufferRef).get (), Dimensions, sizeof (DataT),
1106
- BufferRef.OffsetInBytes , BufferRef.IsSubBuffer ) {
1106
+ BufferRef.OffsetInBytes , BufferRef.IsSubBuffer , PropertyList ) {
1107
1107
preScreenAccessor (BufferRef.size (), PropertyList);
1108
1108
detail::associateWithHandler (CommandGroupHandler, this , AccessTarget);
1109
1109
detail::constructorNotification (detail::getSyclObjImpl (BufferRef).get (),
@@ -1133,7 +1133,7 @@ class __SYCL_SPECIAL_CLASS accessor :
1133
1133
detail::convertToArrayOfN<3 , 1 >(BufferRef.get_range ()),
1134
1134
getAdjustedMode (PropertyList),
1135
1135
detail::getSyclObjImpl (BufferRef).get (), Dimensions, sizeof (DataT),
1136
- BufferRef.OffsetInBytes , BufferRef.IsSubBuffer ) {
1136
+ BufferRef.OffsetInBytes , BufferRef.IsSubBuffer , PropertyList ) {
1137
1137
preScreenAccessor (BufferRef.size (), PropertyList);
1138
1138
if (!IsPlaceH)
1139
1139
addHostAccessorAndWait (AccessorBaseHost::impl.get ());
@@ -1166,7 +1166,7 @@ class __SYCL_SPECIAL_CLASS accessor :
1166
1166
detail::convertToArrayOfN<3 , 1 >(BufferRef.get_range ()),
1167
1167
getAdjustedMode (PropertyList),
1168
1168
detail::getSyclObjImpl (BufferRef).get (), Dimensions, sizeof (DataT),
1169
- BufferRef.OffsetInBytes , BufferRef.IsSubBuffer ) {
1169
+ BufferRef.OffsetInBytes , BufferRef.IsSubBuffer , PropertyList ) {
1170
1170
preScreenAccessor (BufferRef.size (), PropertyList);
1171
1171
if (!IsPlaceH)
1172
1172
addHostAccessorAndWait (AccessorBaseHost::impl.get ());
@@ -1229,7 +1229,7 @@ class __SYCL_SPECIAL_CLASS accessor :
1229
1229
detail::convertToArrayOfN<3 , 1 >(BufferRef.get_range ()),
1230
1230
getAdjustedMode (PropertyList),
1231
1231
detail::getSyclObjImpl (BufferRef).get (), Dimensions, sizeof (DataT),
1232
- BufferRef.OffsetInBytes , BufferRef.IsSubBuffer ) {
1232
+ BufferRef.OffsetInBytes , BufferRef.IsSubBuffer , PropertyList ) {
1233
1233
preScreenAccessor (BufferRef.size (), PropertyList);
1234
1234
detail::associateWithHandler (CommandGroupHandler, this , AccessTarget);
1235
1235
detail::constructorNotification (detail::getSyclObjImpl (BufferRef).get (),
@@ -1261,7 +1261,7 @@ class __SYCL_SPECIAL_CLASS accessor :
1261
1261
detail::convertToArrayOfN<3 , 1 >(BufferRef.get_range ()),
1262
1262
getAdjustedMode (PropertyList),
1263
1263
detail::getSyclObjImpl (BufferRef).get (), Dimensions, sizeof (DataT),
1264
- BufferRef.OffsetInBytes , BufferRef.IsSubBuffer ) {
1264
+ BufferRef.OffsetInBytes , BufferRef.IsSubBuffer , PropertyList ) {
1265
1265
preScreenAccessor (BufferRef.size (), PropertyList);
1266
1266
detail::associateWithHandler (CommandGroupHandler, this , AccessTarget);
1267
1267
detail::constructorNotification (detail::getSyclObjImpl (BufferRef).get (),
@@ -1447,7 +1447,7 @@ class __SYCL_SPECIAL_CLASS accessor :
1447
1447
getAdjustedMode (PropertyList),
1448
1448
detail::getSyclObjImpl (BufferRef).get (), Dimensions,
1449
1449
sizeof (DataT), BufferRef.OffsetInBytes ,
1450
- BufferRef.IsSubBuffer ) {
1450
+ BufferRef.IsSubBuffer , PropertyList ) {
1451
1451
preScreenAccessor (BufferRef.size (), PropertyList);
1452
1452
if (BufferRef.isOutOfBounds (AccessOffset, AccessRange,
1453
1453
BufferRef.get_range ()))
@@ -1488,7 +1488,7 @@ class __SYCL_SPECIAL_CLASS accessor :
1488
1488
getAdjustedMode (PropertyList),
1489
1489
detail::getSyclObjImpl (BufferRef).get (), Dimensions,
1490
1490
sizeof (DataT), BufferRef.OffsetInBytes ,
1491
- BufferRef.IsSubBuffer ) {
1491
+ BufferRef.IsSubBuffer , PropertyList ) {
1492
1492
preScreenAccessor (BufferRef.size (), PropertyList);
1493
1493
if (BufferRef.isOutOfBounds (AccessOffset, AccessRange,
1494
1494
BufferRef.get_range ()))
@@ -1560,7 +1560,7 @@ class __SYCL_SPECIAL_CLASS accessor :
1560
1560
getAdjustedMode (PropertyList),
1561
1561
detail::getSyclObjImpl (BufferRef).get (), Dimensions,
1562
1562
sizeof (DataT), BufferRef.OffsetInBytes ,
1563
- BufferRef.IsSubBuffer ) {
1563
+ BufferRef.IsSubBuffer , PropertyList ) {
1564
1564
preScreenAccessor (BufferRef.size (), PropertyList);
1565
1565
if (BufferRef.isOutOfBounds (AccessOffset, AccessRange,
1566
1566
BufferRef.get_range ()))
@@ -1600,7 +1600,7 @@ class __SYCL_SPECIAL_CLASS accessor :
1600
1600
getAdjustedMode (PropertyList),
1601
1601
detail::getSyclObjImpl (BufferRef).get (), Dimensions,
1602
1602
sizeof (DataT), BufferRef.OffsetInBytes ,
1603
- BufferRef.IsSubBuffer ) {
1603
+ BufferRef.IsSubBuffer , PropertyList ) {
1604
1604
preScreenAccessor (BufferRef.size (), PropertyList);
1605
1605
if (BufferRef.isOutOfBounds (AccessOffset, AccessRange,
1606
1606
BufferRef.get_range ()))
@@ -1785,6 +1785,50 @@ class __SYCL_SPECIAL_CLASS accessor :
1785
1785
return constant_ptr<DataT>(getPointerAdjusted ());
1786
1786
}
1787
1787
1788
+ // accessor::has_property for runtime properties is only available in host
1789
+ // code. This restriction is not listed in the core spec and will be added in
1790
+ // future versions.
1791
+ template <typename Property>
1792
+ typename sycl::detail::enable_if_t <
1793
+ !ext::oneapi::is_compile_time_property<Property>::value, bool >
1794
+ has_property () const noexcept {
1795
+ #ifndef __SYCL_DEVICE_ONLY__
1796
+ return AccessorBaseHost::impl->MPropertyList .has_property <Property>();
1797
+ #else
1798
+ return false ;
1799
+ #endif
1800
+ }
1801
+
1802
+ // accessor::get_property for runtime properties is only available in host
1803
+ // code. This restriction is not listed in the core spec and will be added in
1804
+ // future versions.
1805
+ template <typename Property,
1806
+ typename = typename sycl::detail::enable_if_t <
1807
+ !ext::oneapi::is_compile_time_property<Property>::value>>
1808
+ Property get_property () const {
1809
+ #ifndef __SYCL_DEVICE_ONLY__
1810
+ return AccessorBaseHost::impl->MPropertyList .get_property <Property>();
1811
+ #else
1812
+ return Property ();
1813
+ #endif
1814
+ }
1815
+
1816
+ #if __cplusplus >= 201703L
1817
+ template <typename Property>
1818
+ static constexpr bool has_property (
1819
+ typename std::enable_if_t <
1820
+ ext::oneapi::is_compile_time_property<Property>::value> * = 0 ) {
1821
+ return PropertyListT::template has_property<Property>();
1822
+ }
1823
+
1824
+ template <typename Property>
1825
+ static constexpr auto get_property (
1826
+ typename std::enable_if_t <
1827
+ ext::oneapi::is_compile_time_property<Property>::value> * = 0 ) {
1828
+ return PropertyListT::template get_property<Property>();
1829
+ }
1830
+ #endif
1831
+
1788
1832
bool operator ==(const accessor &Rhs) const { return impl == Rhs.impl ; }
1789
1833
bool operator !=(const accessor &Rhs) const { return !(*this == Rhs); }
1790
1834
0 commit comments