50 #include <type_traits>
226 inline namespace _V1 {
228 namespace ext::intel::esimd::detail {
230 class AccessorPrivateProxy;
262 template <
typename T>
265 template <
typename T>
267 typename std::is_same<ext::oneapi::accessor_property_list<>, T>;
270 constexpr
static bool value =
false;
273 template <
typename... Props>
279 constexpr
static bool value =
false;
284 template <
typename BufferT>
286 return std::min(Buffer.size(),
size_t{1});
298 constexpr
static bool IsHostBuf = AccessTarget == access::target::host_buffer;
316 AccessTarget == access::target::global_buffer;
319 AccessTarget == access::target::constant_buffer;
328 static constexpr
bool IsConst = std::is_const_v<DataT>;
341 template <
int SubDims,
361 template <
int CurDims = SubDims,
typename = std::enable_if_t<(CurDims > 1)>>
363 MIDs[Dims - CurDims] = Index;
367 template <
int CurDims = SubDims,
371 MIDs[Dims - CurDims] = Index;
372 return MAccessor[MIDs];
375 template <
int CurDims = SubDims>
376 typename std::enable_if_t<CurDims == 1 && IsAccessAtomic, atomic<DataT, AS>>
378 MIDs[Dims - CurDims] = Index;
379 return MAccessor[MIDs];
385 if constexpr (std::is_const_v<DataT>)
391 template <
typename MayBeTag1,
typename MayBeTag2>
406 if constexpr (std::is_same_v<
409 access::target::constant_buffer>> ||
413 access::target::constant_buffer>>) {
417 if constexpr (std::is_same_v<MayBeTag1,
420 std::is_same_v<MayBeTag2,
426 if constexpr (std::is_same_v<MayBeTag1,
429 std::is_same_v<MayBeTag2,
438 template <
typename MayBeTag1,
typename MayBeTag2>
440 if constexpr (std::is_same_v<
443 access::target::constant_buffer>> ||
447 access::target::constant_buffer>>) {
448 return access::target::constant_buffer;
467 return defaultTarget;
508 class AccessorImplHost;
523 int ElemSize,
size_t OffsetInBytes = 0,
524 bool IsSubBuffer =
false,
529 int ElemSize,
bool IsPlaceH,
size_t OffsetInBytes = 0,
530 bool IsSubBuffer =
false,
538 unsigned int getElemSize() const;
540 const
id<3> &getOffset() const;
541 const
range<3> &getAccessRange() const;
542 const
range<3> &getMemoryRange() const;
545 bool isMemoryObjectUsedByGraph() const;
547 detail::AccHostDataT &getAccData();
551 void *getMemoryObject() const;
566 friend class
sycl::ext::intel::esimd::detail::AccessorPrivateProxy;
582 void *getPtr()
const;
584 int getElementSize();
589 friend const decltype(Obj::impl) &
606 typename PropertyListT>
608 #ifndef __SYCL_DEVICE_ONLY__
612 IsPlaceholder, PropertyListT>,
614 accessor<DataT, Dimensions, AccessMode, AccessTarget, IsPlaceholder,
617 static_assert((AccessTarget == access::target::global_buffer ||
618 AccessTarget == access::target::constant_buffer ||
619 AccessTarget == access::target::host_buffer ||
621 "Expected buffer type");
623 static_assert((AccessTarget == access::target::global_buffer ||
624 AccessTarget == access::target::host_buffer ||
626 (AccessTarget == access::target::constant_buffer &&
628 "Access mode can be only read for constant buffers");
631 "PropertyListT must be accessor_property_list");
633 using AccessorCommonT =
639 using AccessorCommonT::AS;
642 static constexpr
bool IsAccessAnyWrite = AccessorCommonT::IsAccessAnyWrite;
643 static constexpr
bool IsAccessReadOnly = AccessorCommonT::IsAccessReadOnly;
644 static constexpr
bool IsConstantBuf = AccessorCommonT::IsConstantBuf;
645 static constexpr
bool IsGlobalBuf = AccessorCommonT::IsGlobalBuf;
646 static constexpr
bool IsHostBuf = AccessorCommonT::IsHostBuf;
647 static constexpr
bool IsPlaceH = AccessorCommonT::IsPlaceH;
648 static constexpr
bool IsConst = AccessorCommonT::IsConst;
649 static constexpr
bool IsHostTask = AccessorCommonT::IsHostTask;
651 using AccessorSubscript =
652 typename AccessorCommonT::template AccessorSubscript<Dims>;
655 !IsConst || IsAccessReadOnly,
656 "A const qualified DataT is only allowed for a read-only accessor");
659 typename std::conditional_t<IsAccessReadOnly && !IsConstantBuf,
664 using ConstRefType =
const DataT &;
670 detail::loop<Dims>([&,
this](
size_t I) {
671 Result = Result * getMemoryRange()[I] + Id[I];
674 #ifndef __SYCL_DEVICE_ONLY__
677 Result += getOffset()[I];
685 template <
typename T,
int Dims>
686 struct IsSameAsBuffer
687 : std::bool_constant<std::is_same_v<T, DataT> && (Dims > 0) &&
688 (Dims == Dimensions)> {};
690 static access::mode getAdjustedMode(
const PropertyListT &PropertyList) {
693 if (PropertyList.template has_property<property::no_init>() ||
694 PropertyList.template has_property<property::noinit>()) {
705 template <
typename TagT>
708 std::is_same<TagT, mode_tag_t<AccessMode>>,
709 std::is_same<TagT, mode_target_tag_t<AccessMode, AccessTarget>>> {};
711 template <
typename DataT_,
int Dimensions_,
access::mode AccessMode_,
713 typename PropertyListT_>
716 #ifdef __SYCL_DEVICE_ONLY__
718 id<AdjustedDim> &getOffset() {
return impl.Offset; }
719 range<AdjustedDim> &getAccessRange() {
return impl.AccessRange; }
720 range<AdjustedDim> &getMemoryRange() {
return impl.MemRange; }
722 const id<AdjustedDim> &getOffset()
const {
return impl.Offset; }
723 const range<AdjustedDim> &getAccessRange()
const {
return impl.AccessRange; }
724 const range<AdjustedDim> &getMemoryRange()
const {
return impl.MemRange; }
726 detail::AccessorImplDevice<AdjustedDim> impl;
729 ConcreteASPtrType MData;
732 void __init(ConcreteASPtrType Ptr, range<AdjustedDim> AccessRange,
733 range<AdjustedDim> MemRange, id<AdjustedDim> Offset) {
735 detail::loop<AdjustedDim>([&,
this](
size_t I) {
738 getOffset()[I] = Offset[I];
740 getAccessRange()[I] = AccessRange[I];
741 getMemoryRange()[I] = MemRange[I];
746 MData += getTotalOffset();
752 void __init_esimd(ConcreteASPtrType Ptr) {
754 #ifdef __ESIMD_FORCE_STATELESS_MEM
755 detail::loop<AdjustedDim>([&,
this](
size_t I) {
757 getAccessRange()[I] = 0;
758 getMemoryRange()[I] = 0;
763 ConcreteASPtrType getQualifiedPtr() const
noexcept {
return MData; }
765 #ifndef __SYCL_DEVICE_ONLY__
772 : impl({}, detail::InitializedVal<AdjustedDim, range>::template get<0>(),
773 detail::InitializedVal<AdjustedDim, range>::template get<0>()) {}
777 : detail::AccessorBaseHost{Impl} {}
781 const id<3> getOffset()
const {
782 if constexpr (IsHostBuf)
783 return MAccData ? MAccData->MOffset : id<3>();
787 const range<3> &getAccessRange()
const {
790 const range<3> getMemoryRange()
const {
791 if constexpr (IsHostBuf)
792 return MAccData ? MAccData->MMemoryRange : range(0, 0, 0);
799 void initHostAcc() { MAccData = &getAccData(); }
802 void GDBMethodsAnchor() {
804 const auto *this_const =
this;
805 (void)getMemoryRange();
806 (void)this_const->getMemoryRange();
808 (void)this_const->getOffset();
810 (void)this_const->getPtr();
811 (void)getAccessRange();
812 (void)this_const->getAccessRange();
816 detail::AccHostDataT *MAccData =
nullptr;
818 char padding[
sizeof(detail::AccessorImplDevice<AdjustedDim>) +
819 sizeof(PtrType) -
sizeof(detail::AccessorBaseHost) -
822 PtrType getQualifiedPtr() const
noexcept {
823 if constexpr (IsHostBuf)
824 return MAccData ?
reinterpret_cast<PtrType
>(MAccData->MData) :
nullptr;
832 {0, 0, 0}, {0, 0, 0},
839 template <
typename,
int, access_mode>
friend class host_accessor;
844 friend class sycl::stream;
845 friend class sycl::ext::intel::esimd::detail::AccessorPrivateProxy;
848 friend const decltype(Obj::impl) &
859 std::conditional_t<AccessMode == access_mode::read, const DataT, DataT>;
861 using const_reference =
const DataT &;
863 template <access::decorated IsDecorated>
866 global_ptr<value_type, IsDecorated>,
value_type *>;
868 using iterator =
typename detail::accessor_iterator<value_type, AdjustedDim>;
869 using const_iterator =
870 typename detail::accessor_iterator<const value_type, AdjustedDim>;
871 using reverse_iterator = std::reverse_iterator<iterator>;
872 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
875 using size_type = std::size_t;
879 void throwIfUsedByGraph()
const {
880 #ifndef __SYCL_DEVICE_ONLY__
883 "Host accessors cannot be created for buffers "
884 "which are currently in use by a command graph.");
914 template <
typename DataT_,
915 typename = std::enable_if_t<
916 IsAccessReadOnly && !std::is_same_v<DataT_, DataT> &&
917 std::is_same_v<std::remove_const_t<DataT_>,
918 std::remove_const_t<DataT>>>>
921 #ifdef __SYCL_DEVICE_ONLY__
922 : impl(other.impl), MData(other.MData) {
931 typename = std::enable_if_t<
933 std::is_same_v<std::remove_const_t<DataT_>,
934 std::remove_const_t<DataT>>>>
937 #ifdef __SYCL_DEVICE_ONLY__
938 : impl(other.impl), MData(other.MData) {
944 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
945 typename std::enable_if_t<
946 detail::IsRunTimePropertyListT<PropertyListT>::value &&
947 std::is_same_v<T, DataT> && Dims == 0 &&
948 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))> * =
951 buffer<T, 1, AllocatorT> &BufferRef,
952 const property_list &PropertyList = {},
954 #ifdef __SYCL_DEVICE_ONLY__
956 BufferRef.get_range()) {
962 detail::convertToArrayOfN<3, 1>(
964 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
965 getAdjustedMode(PropertyList),
967 IsPlaceH, BufferRef.OffsetInBytes, BufferRef.IsSubBuffer,
969 throwIfUsedByGraph();
970 preScreenAccessor(PropertyList);
981 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
982 typename... PropTypes,
983 typename std::enable_if_t<
987 std::is_same<T, DataT>::value && Dims == 0 &&
988 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))> * =
991 buffer<T, 1, AllocatorT> &BufferRef,
992 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
995 #ifdef __SYCL_DEVICE_ONLY__
997 BufferRef.get_range()) {
1003 detail::convertToArrayOfN<3, 1>(
1005 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1006 getAdjustedMode(PropertyList),
1008 IsPlaceH, BufferRef.OffsetInBytes, BufferRef.IsSubBuffer,
1010 throwIfUsedByGraph();
1011 preScreenAccessor(PropertyList);
1022 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1023 typename =
typename std::enable_if_t<
1024 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1025 std::is_same_v<T, DataT> && (Dims == 0) &&
1026 (IsGlobalBuf || IsHostBuf || IsConstantBuf || IsHostTask)>>
1028 buffer<T, 1, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1029 const property_list &PropertyList = {},
1031 #ifdef __SYCL_DEVICE_ONLY__
1033 BufferRef.get_range()) {
1034 (void)CommandGroupHandler;
1041 detail::convertToArrayOfN<3, 1>(
1043 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1044 getAdjustedMode(PropertyList),
1046 BufferRef.OffsetInBytes, BufferRef.IsSubBuffer, PropertyList) {
1047 throwIfUsedByGraph();
1048 preScreenAccessor(PropertyList);
1058 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1059 typename... PropTypes,
1060 typename =
typename std::enable_if_t<
1062 std::is_same_v<T, DataT> && (Dims == 0) &&
1063 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1065 buffer<T, 1, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1066 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1069 #ifdef __SYCL_DEVICE_ONLY__
1071 BufferRef.get_range()) {
1072 (void)CommandGroupHandler;
1079 detail::convertToArrayOfN<3, 1>(
1081 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1082 getAdjustedMode(PropertyList),
1084 BufferRef.OffsetInBytes, BufferRef.IsSubBuffer, PropertyList) {
1085 throwIfUsedByGraph();
1086 preScreenAccessor(PropertyList);
1096 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1097 typename = std::enable_if_t<
1098 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1099 IsSameAsBuffer<T, Dims>::value &&
1100 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>>
1102 buffer<T, Dims, AllocatorT> &BufferRef,
1103 const property_list &PropertyList = {},
1105 #ifdef __SYCL_DEVICE_ONLY__
1106 : impl(id<Dimensions>(), BufferRef.get_range(), BufferRef.get_range()) {
1113 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1114 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1115 getAdjustedMode(PropertyList),
1117 IsPlaceH, BufferRef.OffsetInBytes, BufferRef.IsSubBuffer,
1119 throwIfUsedByGraph();
1120 preScreenAccessor(PropertyList);
1131 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1132 typename... PropTypes,
1133 typename = std::enable_if_t<
1135 IsSameAsBuffer<T, Dims>::value &&
1136 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>>
1138 buffer<T, Dims, AllocatorT> &BufferRef,
1139 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1142 #ifdef __SYCL_DEVICE_ONLY__
1143 : impl(id<Dimensions>(), BufferRef.get_range(), BufferRef.get_range()) {
1150 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1151 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1152 getAdjustedMode(PropertyList),
1154 IsPlaceH, BufferRef.OffsetInBytes, BufferRef.IsSubBuffer,
1156 throwIfUsedByGraph();
1157 preScreenAccessor(PropertyList);
1168 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1170 typename = std::enable_if_t<
1171 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1172 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1173 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1175 buffer<T, Dims, AllocatorT> &BufferRef, TagT,
1176 const property_list &PropertyList = {},
1178 :
accessor(BufferRef, PropertyList, CodeLoc) {
1179 adjustAccPropsInBuf(BufferRef);
1182 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1183 typename TagT,
typename... PropTypes,
1184 typename = std::enable_if_t<
1186 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1187 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1189 buffer<T, Dims, AllocatorT> &BufferRef, TagT,
1190 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1193 :
accessor(BufferRef, PropertyList, CodeLoc) {
1194 adjustAccPropsInBuf(BufferRef);
1197 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1198 typename = std::enable_if_t<
1199 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1200 IsSameAsBuffer<T, Dims>::value &&
1201 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1203 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1204 const property_list &PropertyList = {},
1206 #ifdef __SYCL_DEVICE_ONLY__
1207 : impl(id<AdjustedDim>(), BufferRef.get_range(), BufferRef.get_range()) {
1208 (void)CommandGroupHandler;
1215 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1216 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1217 getAdjustedMode(PropertyList),
1219 BufferRef.OffsetInBytes, BufferRef.IsSubBuffer, PropertyList) {
1220 throwIfUsedByGraph();
1221 preScreenAccessor(PropertyList);
1231 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1232 typename... PropTypes,
1233 typename = std::enable_if_t<
1235 IsSameAsBuffer<T, Dims>::value &&
1236 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1238 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1239 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1242 #ifdef __SYCL_DEVICE_ONLY__
1243 : impl(id<AdjustedDim>(), BufferRef.get_range(), BufferRef.get_range()) {
1244 (void)CommandGroupHandler;
1251 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1252 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1253 getAdjustedMode(PropertyList),
1255 BufferRef.OffsetInBytes, BufferRef.IsSubBuffer, PropertyList) {
1256 throwIfUsedByGraph();
1257 preScreenAccessor(PropertyList);
1267 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1269 typename = std::enable_if_t<
1270 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1271 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1272 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1274 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1275 TagT,
const property_list &PropertyList = {},
1277 :
accessor(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {
1278 adjustAccPropsInBuf(BufferRef);
1281 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1282 typename TagT,
typename... PropTypes,
1283 typename = std::enable_if_t<
1285 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1286 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1288 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1290 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1293 :
accessor(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {
1294 adjustAccPropsInBuf(BufferRef);
1297 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1298 typename = std::enable_if_t<
1299 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1300 IsSameAsBuffer<T, Dims>::value &&
1301 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>>
1303 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
1304 const property_list &PropertyList = {},
1306 :
accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {}
1308 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1309 typename... PropTypes,
1310 typename = std::enable_if_t<
1312 IsSameAsBuffer<T, Dims>::value &&
1313 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>>
1315 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
1316 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1319 :
accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {}
1321 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1323 typename = std::enable_if_t<
1324 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1325 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1326 (IsGlobalBuf || IsConstantBuf || IsHostTask)>>
1328 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
1329 TagT,
const property_list &PropertyList = {},
1331 :
accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {
1332 adjustAccPropsInBuf(BufferRef);
1335 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1336 typename TagT,
typename... PropTypes,
1337 typename = std::enable_if_t<
1339 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1340 (IsGlobalBuf || IsConstantBuf || IsHostTask)>>
1342 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
1344 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1347 :
accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {
1348 adjustAccPropsInBuf(BufferRef);
1351 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1352 typename = std::enable_if_t<
1353 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1354 IsSameAsBuffer<T, Dims>::value &&
1355 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1357 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1358 range<Dimensions> AccessRange,
const property_list &PropertyList = {},
1360 :
accessor(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList,
1363 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1364 typename... PropTypes,
1365 typename = std::enable_if_t<
1367 IsSameAsBuffer<T, Dims>::value &&
1368 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1370 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1371 range<Dimensions> AccessRange,
1372 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1375 :
accessor(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList,
1378 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1380 typename = std::enable_if_t<
1381 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1382 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1383 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1385 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1386 range<Dimensions> AccessRange, TagT,
1387 const property_list &PropertyList = {},
1389 :
accessor(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList,
1391 adjustAccPropsInBuf(BufferRef);
1394 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1395 typename TagT,
typename... PropTypes,
1396 typename = std::enable_if_t<
1398 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1399 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1401 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1402 range<Dimensions> AccessRange, TagT,
1403 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1406 :
accessor(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList,
1408 adjustAccPropsInBuf(BufferRef);
1411 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1412 typename = std::enable_if_t<
1413 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1414 IsSameAsBuffer<T, Dims>::value &&
1415 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>>
1417 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
1418 id<Dimensions> AccessOffset,
const property_list &PropertyList = {},
1420 #ifdef __SYCL_DEVICE_ONLY__
1421 : impl(AccessOffset, AccessRange, BufferRef.get_range()) {
1426 : AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset),
1427 detail::convertToArrayOfN<3, 1>(AccessRange),
1428 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1429 getAdjustedMode(PropertyList),
1431 sizeof(DataT), IsPlaceH, BufferRef.OffsetInBytes,
1432 BufferRef.IsSubBuffer, PropertyList) {
1433 throwIfUsedByGraph();
1434 preScreenAccessor(PropertyList);
1437 if (BufferRef.isOutOfBounds(AccessOffset, AccessRange,
1438 BufferRef.get_range()))
1440 "accessor with requested offset and range would "
1441 "exceed the bounds of the buffer");
1451 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1452 typename... PropTypes,
1453 typename = std::enable_if_t<
1455 IsSameAsBuffer<T, Dims>::value &&
1456 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>>
1458 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
1459 id<Dimensions> AccessOffset,
1460 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1463 #ifdef __SYCL_DEVICE_ONLY__
1464 : impl(AccessOffset, AccessRange, BufferRef.get_range()) {
1469 : AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset),
1470 detail::convertToArrayOfN<3, 1>(AccessRange),
1471 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1472 getAdjustedMode(PropertyList),
1474 sizeof(DataT), IsPlaceH, BufferRef.OffsetInBytes,
1475 BufferRef.IsSubBuffer, PropertyList) {
1476 throwIfUsedByGraph();
1477 preScreenAccessor(PropertyList);
1480 if (BufferRef.isOutOfBounds(AccessOffset, AccessRange,
1481 BufferRef.get_range()))
1483 "accessor with requested offset and range would "
1484 "exceed the bounds of the buffer");
1494 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1496 typename = std::enable_if_t<
1497 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1498 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1499 (IsGlobalBuf || IsConstantBuf || IsHostTask)>>
1501 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
1502 id<Dimensions> AccessOffset, TagT,
const property_list &PropertyList = {},
1504 :
accessor(BufferRef, AccessRange, AccessOffset, PropertyList, CodeLoc) {
1505 adjustAccPropsInBuf(BufferRef);
1508 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1509 typename TagT,
typename... PropTypes,
1510 typename = std::enable_if_t<
1512 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1513 (IsGlobalBuf || IsConstantBuf || IsHostTask)>>
1515 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
1516 id<Dimensions> AccessOffset, TagT,
1517 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1520 :
accessor(BufferRef, AccessRange, AccessOffset, PropertyList, CodeLoc) {
1521 adjustAccPropsInBuf(BufferRef);
1524 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1525 typename = std::enable_if_t<
1526 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1527 IsSameAsBuffer<T, Dims>::value &&
1528 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1530 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1531 range<Dimensions> AccessRange, id<Dimensions> AccessOffset,
1532 const property_list &PropertyList = {},
1534 #ifdef __SYCL_DEVICE_ONLY__
1535 : impl(AccessOffset, AccessRange, BufferRef.get_range()) {
1536 (void)CommandGroupHandler;
1541 : AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset),
1542 detail::convertToArrayOfN<3, 1>(AccessRange),
1543 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1544 getAdjustedMode(PropertyList),
1546 sizeof(DataT), BufferRef.OffsetInBytes,
1547 BufferRef.IsSubBuffer, PropertyList) {
1548 throwIfUsedByGraph();
1549 preScreenAccessor(PropertyList);
1550 if (BufferRef.isOutOfBounds(AccessOffset, AccessRange,
1551 BufferRef.get_range()))
1553 "accessor with requested offset and range would "
1554 "exceed the bounds of the buffer");
1565 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1566 typename... PropTypes,
1567 typename = std::enable_if_t<
1569 IsSameAsBuffer<T, Dims>::value &&
1570 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1572 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1573 range<Dimensions> AccessRange, id<Dimensions> AccessOffset,
1574 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1577 #ifdef __SYCL_DEVICE_ONLY__
1578 : impl(AccessOffset, AccessRange, BufferRef.get_range()) {
1579 (void)CommandGroupHandler;
1584 : AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset),
1585 detail::convertToArrayOfN<3, 1>(AccessRange),
1586 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1587 getAdjustedMode(PropertyList),
1589 sizeof(DataT), BufferRef.OffsetInBytes,
1590 BufferRef.IsSubBuffer, PropertyList) {
1591 throwIfUsedByGraph();
1592 preScreenAccessor(PropertyList);
1593 if (BufferRef.isOutOfBounds(AccessOffset, AccessRange,
1594 BufferRef.get_range()))
1596 "accessor with requested offset and range would "
1597 "exceed the bounds of the buffer");
1608 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1610 typename = std::enable_if_t<
1611 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1612 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1613 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1615 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1616 range<Dimensions> AccessRange, id<Dimensions> AccessOffset, TagT,
1617 const property_list &PropertyList = {},
1619 :
accessor(BufferRef, CommandGroupHandler, AccessRange, AccessOffset,
1620 PropertyList, CodeLoc) {
1621 adjustAccPropsInBuf(BufferRef);
1624 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1625 typename TagT,
typename... PropTypes,
1626 typename = std::enable_if_t<
1628 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1629 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1631 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1632 range<Dimensions> AccessRange, id<Dimensions> AccessOffset, TagT,
1633 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1636 :
accessor(BufferRef, CommandGroupHandler, AccessRange, AccessOffset,
1637 PropertyList, CodeLoc) {
1638 adjustAccPropsInBuf(BufferRef);
1641 template <
typename... NewPropsT>
1644 ext::oneapi::accessor_property_list<NewPropsT...>> &Other,
1646 #ifdef __SYCL_DEVICE_ONLY__
1647 : impl(Other.impl), MData(Other.MData)
1649 : detail::AccessorBaseHost(Other), MAccData(Other.MAccData)
1653 "Conversion is only available for accessor_property_list");
1655 PropertyListT::template areSameCompileTimeProperties<NewPropsT...>(),
1656 "Compile-time-constant properties must be the same");
1658 #ifndef __SYCL_DEVICE_ONLY__
1664 void swap(accessor &other) {
1665 std::swap(impl, other.impl);
1666 #ifdef __SYCL_DEVICE_ONLY__
1667 std::swap(MData, other.MData);
1669 std::swap(MAccData, other.MAccData);
1673 bool is_placeholder()
const {
1674 #ifdef __SYCL_DEVICE_ONLY__
1681 size_t get_size()
const {
return getAccessRange().size() *
sizeof(DataT); }
1684 size_t get_count()
const {
return size(); }
1685 size_type size() const
noexcept {
return getAccessRange().size(); }
1687 size_type byte_size() const
noexcept {
return size() *
sizeof(DataT); }
1689 size_type max_size() const
noexcept {
1696 typename = std::enable_if_t<Dims ==
Dimensions && (Dims > 0)>>
1697 range<Dimensions> get_range()
const {
1698 return getRange<Dims>();
1702 typename = std::enable_if_t<Dims ==
Dimensions && (Dims > 0)>>
1704 return getOffset<Dims>();
1707 template <
int Dims =
Dimensions,
typename RefT = RefType,
1708 typename = std::enable_if_t<Dims == 0 &&
1709 (IsAccessAnyWrite || IsAccessReadOnly)>>
1712 return *(getQualifiedPtr() + LinearIndex);
1717 !IsAccessReadOnly && Dims == 0>>
1719 *getQualifiedPtr() = Other;
1725 !IsAccessReadOnly && Dims == 0>>
1727 *getQualifiedPtr() = std::move(Other);
1732 typename = std::enable_if_t<(Dims > 0) &&
1733 (IsAccessAnyWrite || IsAccessReadOnly)>>
1736 return getQualifiedPtr()[LinearIndex];
1739 template <
int Dims = Dimensions>
1740 operator typename std::enable_if_t<Dims == 0 &&
1742 #ifdef __ENABLE_USM_ADDR_SPACE__
1749 return atomic<DataT, AS>(multi_ptr<DataT, AS, access::decorated::yes>(
1750 getQualifiedPtr() + LinearIndex));
1753 template <
int Dims = Dimensions>
1756 operator[](id<Dimensions> Index)
const {
1758 return atomic<DataT, AS>(multi_ptr<DataT, AS, access::decorated::yes>(
1759 getQualifiedPtr() + LinearIndex));
1762 template <
int Dims = Dimensions>
1766 const size_t LinearIndex =
getLinearIndex(id<AdjustedDim>(Index));
1767 return atomic<DataT, AS>(multi_ptr<DataT, AS, access::decorated::yes>(
1768 getQualifiedPtr() + LinearIndex));
1770 template <
int Dims = Dimensions,
typename = std::enable_if_t<(Dims > 1)>>
1772 return AccessorSubscript<Dims - 1>(*
this, Index);
1776 typename = std::enable_if_t<
1777 (AccessTarget_ == access::target::host_buffer) ||
1779 std::add_pointer_t<value_type> get_pointer() const
noexcept {
1780 return getPointerAdjusted();
1787 "accessor::get_pointer() is deprecated, please use get_multi_ptr()")
1789 return global_ptr<value_type>(
1790 const_cast<typename detail::DecoratedType<value_type, AS>::type *
>(
1791 getPointerAdjusted()));
1795 typename = std::enable_if_t<AccessTarget_ ==
1796 access::target::constant_buffer>>
1797 constant_ptr<DataT> get_pointer()
const {
1798 return constant_ptr<DataT>(getPointerAdjusted());
1803 std::enable_if_t<AccessTarget_ == access::target::device, int> = 0>
1804 accessor_ptr<IsDecorated> get_multi_ptr() const
noexcept {
1805 return accessor_ptr<IsDecorated>(getPointerAdjusted());
1810 std::enable_if_t<AccessTarget_ != access::target::device, int> = 0>
1812 "accessor::get_multi_ptr() is deprecated for non-device accessors")
1813 accessor_ptr<IsDecorated> get_multi_ptr() const
noexcept {
1814 return accessor_ptr<IsDecorated>(getPointerAdjusted());
1820 template <
typename Property>
1821 typename std::enable_if_t<
1822 !ext::oneapi::is_compile_time_property<Property>::value,
bool>
1824 #ifndef __SYCL_DEVICE_ONLY__
1825 return getPropList().template has_property<Property>();
1834 template <
typename Property,
1835 typename =
typename std::enable_if_t<
1836 !ext::oneapi::is_compile_time_property<Property>::value>>
1838 #ifndef __SYCL_DEVICE_ONLY__
1839 return getPropList().template get_property<Property>();
1845 template <
typename Property>
1847 typename std::enable_if_t<
1848 ext::oneapi::is_compile_time_property<Property>::value> * = 0) {
1849 return PropertyListT::template has_property<Property>();
1852 template <
typename Property>
1854 typename std::enable_if_t<
1855 ext::oneapi::is_compile_time_property<Property>::value> * = 0) {
1856 return PropertyListT::template get_property<Property>();
1859 bool operator==(
const accessor &Rhs)
const {
return impl == Rhs.impl; }
1860 bool operator!=(
const accessor &Rhs)
const {
return !(*
this == Rhs); }
1863 return iterator::getBegin(
1865 detail::convertToArrayOfN<AdjustedDim, 1>(getMemoryRange()),
1866 getRange<AdjustedDim>(), getOffset<AdjustedDim>());
1870 return iterator::getEnd(
1872 detail::convertToArrayOfN<AdjustedDim, 1>(getMemoryRange()),
1873 getRange<AdjustedDim>(), getOffset<AdjustedDim>());
1876 const_iterator cbegin() const
noexcept {
1877 return const_iterator::getBegin(
1879 detail::convertToArrayOfN<AdjustedDim, 1>(getMemoryRange()),
1880 getRange<AdjustedDim>(), getOffset<AdjustedDim>());
1883 const_iterator cend() const
noexcept {
1884 return const_iterator::getEnd(
1886 detail::convertToArrayOfN<AdjustedDim, 1>(getMemoryRange()),
1887 getRange<AdjustedDim>(), getOffset<AdjustedDim>());
1890 reverse_iterator rbegin() const
noexcept {
return reverse_iterator(
end()); }
1891 reverse_iterator rend() const
noexcept {
return reverse_iterator(begin()); }
1893 const_reverse_iterator crbegin() const
noexcept {
1894 return const_reverse_iterator(cend());
1896 const_reverse_iterator crend() const
noexcept {
1897 return const_reverse_iterator(cbegin());
1901 template <
int Dims,
typename = std::enable_if_t<(Dims > 0)>>
1902 range<Dims> getRange()
const {
1903 return detail::convertToArrayOfN<AdjustedDim, 1>(getAccessRange());
1906 template <
int Dims = Dimensions,
typename = std::enable_if_t<(Dims > 0)>>
1907 id<Dims> getOffset()
const {
1911 "Accessor has no_offset property, get_offset() can not be used");
1912 return detail::convertToArrayOfN<Dims, 0>(getOffset());
1915 #ifdef __SYCL_DEVICE_ONLY__
1916 size_t getTotalOffset() const
noexcept {
1917 size_t TotalOffset = 0;
1918 detail::loop<Dimensions>([&,
this](
size_t I) {
1919 TotalOffset = TotalOffset * impl.MemRange[I];
1922 TotalOffset += impl.Offset[I];
1935 auto getPointerAdjusted() const
noexcept {
1936 #ifdef __SYCL_DEVICE_ONLY__
1937 return getQualifiedPtr() - getTotalOffset();
1939 return getQualifiedPtr();
1943 void preScreenAccessor(
const PropertyListT &PropertyList) {
1945 if (PropertyList.template has_property<property::no_init>() &&
1948 "accessor cannot be both read_only and no_init");
1952 template <
typename BufT,
typename... PropTypes>
1953 void adjustAccPropsInBuf(BufT &Buffer) {
1959 property_list PropList{
1961 Buffer.addOrReplaceAccessorProperties(PropList);
1963 deleteAccPropsFromBuf(Buffer);
1967 template <
typename BufT>
void deleteAccPropsFromBuf(BufT &Buffer) {
1968 Buffer.deleteAccProps(
1973 template <
typename DataT,
int Dimensions,
typename AllocatorT>
1978 template <
typename DataT,
int Dimensions,
typename AllocatorT,
1986 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1>
1989 detail::deduceAccessTarget<Type1, Type1>(target::device),
1992 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
1997 detail::deduceAccessTarget<Type1, Type1>(target::device),
2001 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2005 detail::deduceAccessTarget<Type1, Type2>(target::device),
2008 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2009 typename Type2,
typename... PropsT>
2013 detail::deduceAccessTarget<Type1, Type2>(target::device),
2017 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2018 typename Type2,
typename Type3>
2021 detail::deduceAccessTarget<Type2, Type3>(target::device),
2024 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2025 typename Type2,
typename Type3,
typename... PropsT>
2029 detail::deduceAccessTarget<Type2, Type3>(target::device),
2033 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2034 typename Type2,
typename Type3,
typename Type4>
2037 detail::deduceAccessTarget<Type3, Type4>(target::device),
2040 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2041 typename Type2,
typename Type3,
typename Type4,
typename... PropsT>
2045 detail::deduceAccessTarget<Type3, Type4>(target::device),
2049 template <
typename DataT,
int Dimensions,
typename AllocatorT>
2054 template <
typename DataT,
int Dimensions,
typename AllocatorT,
2062 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1>
2065 detail::deduceAccessTarget<Type1, Type1>(target::device),
2068 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2073 detail::deduceAccessTarget<Type1, Type1>(target::device),
2077 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2081 detail::deduceAccessTarget<Type1, Type2>(target::device),
2084 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2085 typename Type2,
typename... PropsT>
2089 detail::deduceAccessTarget<Type1, Type2>(target::device),
2093 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2094 typename Type2,
typename Type3>
2097 detail::deduceAccessTarget<Type2, Type3>(target::device),
2100 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2101 typename Type2,
typename Type3,
typename... PropsT>
2105 detail::deduceAccessTarget<Type2, Type3>(target::device),
2109 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2110 typename Type2,
typename Type3,
typename Type4>
2114 detail::deduceAccessTarget<Type3, Type4>(target::device),
2117 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2118 typename Type2,
typename Type3,
typename Type4,
typename... PropsT>
2122 detail::deduceAccessTarget<Type3, Type4>(target::device),
2132 #ifndef __SYCL_DEVICE_ONLY__
2136 access::target::local, IsPlaceholder> {
2144 using AccessorCommonT::AS;
2148 static constexpr
bool IsAccessAnyWrite = AccessorCommonT::IsAccessAnyWrite;
2149 static constexpr
bool IsAccessReadOnly = AccessorCommonT::IsAccessReadOnly;
2150 static constexpr
bool IsConst = AccessorCommonT::IsConst;
2163 #ifdef __SYCL_DEVICE_ONLY__
2172 detail::loop<AdjustedDim>(
2173 [&,
this](
size_t I) { getSize()[I] = AccessRange[I]; });
2179 void __init_esimd(ConcreteASPtrType Ptr) {
2181 detail::loop<AdjustedDim>([&,
this](
size_t I) { getSize()[I] = 0; });
2186 local_accessor_base()
2187 : impl(detail::InitializedVal<AdjustedDim, range>::template
get<0>()) {}
2190 ConcreteASPtrType getQualifiedPtr()
const {
return MData; }
2192 ConcreteASPtrType MData;
2197 : detail::LocalAccessorBaseHost{
sycl::
range<3>{0, 0, 0},
2198 0,
sizeof(DataT)} {}
2202 : detail::LocalAccessorBaseHost{Impl} {}
2222 const auto *this_const =
this;
2224 (void)this_const->getSize();
2226 (void)this_const->getPtr();
2236 [&,
this](
size_t I) { Result = Result * getSize()[I] + Id[I]; });
2240 template <
class Obj>
2241 friend const decltype(Obj::impl) &
2254 template <
int Dims = Dimensions,
typename = std::enable_if_t<Dims == 0>>
2257 #ifdef __SYCL_DEVICE_ONLY__
2262 : LocalAccessorBaseHost(
range<3>{1, 1, 1}, AdjustedDim,
sizeof(DataT)) {
2269 template <
int Dims = Dimensions,
typename = std::enable_if_t<Dims == 0>>
2273 #ifdef __SYCL_DEVICE_ONLY__
2279 : LocalAccessorBaseHost(
range<3>{1, 1, 1}, AdjustedDim,
sizeof(DataT),
2287 template <
int Dims = Dimensions,
typename = std::enable_if_t<(Dims > 0)>>
2291 #ifdef __SYCL_DEVICE_ONLY__
2292 : impl(AllocationSize) {
2296 : LocalAccessorBaseHost(detail::convertToArrayOfN<3, 1>(AllocationSize),
2297 AdjustedDim,
sizeof(DataT)) {
2305 typename = std::enable_if_t<(Dims > 0)>>
2310 #ifdef __SYCL_DEVICE_ONLY__
2311 : impl(AllocationSize) {
2316 : LocalAccessorBaseHost(detail::convertToArrayOfN<3, 1>(AllocationSize),
2317 AdjustedDim,
sizeof(DataT), propList) {
2324 size_t get_size()
const {
return getSize().size() *
sizeof(DataT); }
2327 size_t get_count()
const {
return size(); }
2330 template <
int Dims = Dimensions,
typename = std::enable_if_t<(Dims > 0)>>
2332 return detail::convertToArrayOfN<Dims, 1>(getSize());
2336 typename = std::enable_if_t<Dims == 0 &&
2337 (IsAccessAnyWrite || IsAccessReadOnly)>>
2339 return *getQualifiedPtr();
2343 typename = std::enable_if_t<(Dims > 0) &&
2344 (IsAccessAnyWrite || IsAccessReadOnly)>>
2347 return getQualifiedPtr()[LinearIndex];
2351 typename = std::enable_if_t<Dims == 1 &&
2352 (IsAccessAnyWrite || IsAccessReadOnly)>>
2354 return getQualifiedPtr()[Index];
2357 template <
int Dims = Dimensions>
2358 operator typename std::enable_if_t<
2361 return atomic<DataT, AS>(
2365 template <
int Dims = Dimensions>
2371 getQualifiedPtr() + LinearIndex));
2374 template <
int Dims = Dimensions>
2379 getQualifiedPtr() + Index));
2382 template <
int Dims = Dimensions,
typename = std::enable_if_t<(Dims > 1)>>
2383 typename AccessorCommonT::template AccessorSubscript<
2391 return impl == Rhs.
impl;
2394 return !(*
this == Rhs);
2405 accessor<DataT, Dimensions, AccessMode, access::target::local,
2412 !local_acc::IsConst || local_acc::IsAccessReadOnly,
2413 "A const qualified DataT is only allowed for a read-only accessor");
2416 using local_acc::local_acc;
2423 #ifdef __SYCL_DEVICE_ONLY__
2427 void __init(
typename local_acc::ConcreteASPtrType Ptr,
2431 local_acc::__init(Ptr, AccessRange,
range,
id);
2437 void __init_esimd(
typename local_acc::ConcreteASPtrType Ptr) {
2438 local_acc::__init_esimd(Ptr);
2444 local_acc::impl = detail::InitializedVal<local_acc::AdjustedDim,
2445 range>::template get<0>();
2454 template <
typename DataT,
int Dimensions = 1>
2456 :
public local_accessor_base<DataT, Dimensions,
2457 detail::accessModeFromConstness<DataT>(),
2458 access::placeholder::false_t>,
2459 public detail::OwnerLessBase<local_accessor<DataT, Dimensions>> {
2463 detail::accessModeFromConstness<DataT>(),
2467 !local_acc::IsConst || local_acc::IsAccessReadOnly,
2468 "A const qualified DataT is only allowed for a read-only accessor");
2471 using local_acc::local_acc;
2473 #ifdef __SYCL_DEVICE_ONLY__
2477 void __init(
typename local_acc::ConcreteASPtrType Ptr,
2478 range<local_acc::AdjustedDim> AccessRange,
2479 range<local_acc::AdjustedDim> range,
2480 id<local_acc::AdjustedDim>
id) {
2481 local_acc::__init(Ptr, AccessRange, range,
id);
2487 void __init_esimd(
typename local_acc::ConcreteASPtrType Ptr) {
2488 local_acc::__init_esimd(Ptr);
2494 local_acc::impl = detail::InitializedVal<local_acc::AdjustedDim,
2495 range>::template get<0>();
2505 template <
typename DataT_,
2506 typename = std::enable_if_t<
2507 std::is_const_v<DataT> &&
2508 std::is_same_v<DataT_, std::remove_const_t<DataT>>>>
2509 local_accessor(
const local_accessor<DataT_, Dimensions> &other) {
2510 local_acc::impl = other.impl;
2511 #ifdef __SYCL_DEVICE_ONLY__
2512 local_acc::MData = other.MData;
2519 using reverse_iterator = std::reverse_iterator<iterator>;
2520 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
2523 using size_type = std::size_t;
2525 template <access::decorated IsDecorated>
2526 using accessor_ptr = local_ptr<value_type, IsDecorated>;
2528 template <
typename DataT_>
2529 bool operator==(
const local_accessor<DataT_, Dimensions> &Rhs)
const {
2530 return local_acc::impl == Rhs.impl;
2533 template <
typename DataT_>
2534 bool operator!=(
const local_accessor<DataT_, Dimensions> &Rhs)
const {
2535 return !(*
this == Rhs);
2538 void swap(local_accessor &other) { std::swap(this->impl, other.impl); }
2540 size_type byte_size() const
noexcept {
return this->size() *
sizeof(DataT); }
2542 size_type max_size() const
noexcept {
2550 return local_acc::getQualifiedPtr();
2558 return begin() + this->size();
2561 const_iterator cbegin() const
noexcept {
return const_iterator(begin()); }
2562 const_iterator cend() const
noexcept {
return const_iterator(
end()); }
2564 reverse_iterator rbegin() const
noexcept {
return reverse_iterator(
end()); }
2565 reverse_iterator rend() const
noexcept {
return reverse_iterator(begin()); }
2567 const_reverse_iterator crbegin() const
noexcept {
2568 return const_reverse_iterator(
end());
2570 const_reverse_iterator crend() const
noexcept {
2571 return const_reverse_iterator(begin());
2575 "local_accessor::get_pointer() is deprecated, please use get_multi_ptr()")
2577 #ifndef __SYCL_DEVICE_ONLY__
2580 "get_pointer must not be called on the host for a local accessor");
2582 return local_ptr<DataT>(local_acc::getQualifiedPtr());
2585 template <access::decorated IsDecorated>
2586 accessor_ptr<IsDecorated> get_multi_ptr() const
noexcept {
2587 #ifndef __SYCL_DEVICE_ONLY__
2590 "get_multi_ptr must not be called on the host for a local accessor");
2592 return accessor_ptr<IsDecorated>(local_acc::getQualifiedPtr());
2596 #ifndef __SYCL_DEVICE_ONLY__
2597 return this->getPropList().template has_property<Property>();
2603 template <
typename Property> Property
get_property()
const {
2604 #ifndef __SYCL_DEVICE_ONLY__
2605 return this->getPropList().template get_property<Property>();
2612 typename = std::enable_if_t<!std::is_const_v<DataT> && Dims == 0>>
2614 *local_acc::getQualifiedPtr() = Other;
2619 typename = std::enable_if_t<!std::is_const_v<DataT> && Dims == 0>>
2621 *local_acc::getQualifiedPtr() = std::move(Other);
2626 friend class sycl::ext::intel::esimd::detail::AccessorPrivateProxy;
2629 template <
typename DataT,
int Dimensions = 1,
2632 :
public accessor<DataT, Dimensions, AccessMode, target::host_buffer,
2633 access::placeholder::false_t> {
2641 template <
typename T,
int Dims>
2643 : std::bool_constant<std::is_same_v<T, DataT> && (Dims > 0) &&
2644 (Dims == Dimensions)> {};
2651 AccessorT::__init(Ptr, AccessRange, MemRange, Offset);
2654 #ifndef __SYCL_DEVICE_ONLY__
2659 template <
class Obj>
2692 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2693 typename =
typename std::enable_if_t<std::is_same_v<T, DataT> &&
2699 : AccessorT(BufferRef, PropertyList, CodeLoc) {}
2701 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2702 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
2707 : AccessorT(BufferRef, PropertyList, CodeLoc) {}
2709 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2710 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
2717 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2718 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
2723 : AccessorT(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {}
2725 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2726 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
2731 :
host_accessor(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {}
2733 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2734 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
2739 : AccessorT(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {}
2741 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2742 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
2747 :
host_accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {}
2749 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2750 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
2755 : AccessorT(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList,
2758 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2759 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
2765 :
host_accessor(BufferRef, CommandGroupHandler, AccessRange, {},
2766 PropertyList, CodeLoc) {}
2768 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2769 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
2774 : AccessorT(BufferRef, AccessRange, AccessOffset, PropertyList, CodeLoc) {
2777 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2778 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
2784 :
host_accessor(BufferRef, AccessRange, AccessOffset, PropertyList,
2787 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2788 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
2794 : AccessorT(BufferRef, CommandGroupHandler, AccessRange, AccessOffset,
2795 PropertyList, CodeLoc) {}
2797 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2798 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
2804 :
host_accessor(BufferRef, CommandGroupHandler, AccessRange, AccessOffset,
2805 PropertyList, CodeLoc) {}
2809 !IsAccessReadOnly && Dims == 0>>
2812 *AccessorT::getQualifiedPtr() = Other;
2818 !IsAccessReadOnly && Dims == 0>>
2820 *AccessorT::getQualifiedPtr() = std::move(Other);
2825 template <
typename DataT_,
2826 typename = std::enable_if_t<
2827 IsAccessReadOnly && !std::is_same_v<DataT_, DataT> &&
2828 std::is_same_v<std::remove_const_t<DataT_>,
2829 std::remove_const_t<DataT>>>>
2831 #ifndef __SYCL_DEVICE_ONLY__
2833 AccessorT::MAccData = other.MAccData;
2843 typename = std::enable_if_t<
2845 std::is_same_v<DataT_, std::remove_const_t<DataT>>>>
2847 #ifndef __SYCL_DEVICE_ONLY__
2849 AccessorT::MAccData = other.MAccData;
2860 #ifndef __SYCL_DEVICE_ONLY__
2864 return this->impl.owner_before(
2869 return this->impl.owner_before(Other.impl);
2872 bool ext_oneapi_owner_before(
2879 template <
typename DataT,
int Dimensions,
typename AllocatorT>
2883 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1>
2886 detail::deduceAccessMode<Type1, Type1>()>;
2888 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2892 detail::deduceAccessMode<Type1, Type2>()>;
2894 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2895 typename Type2,
typename Type3>
2898 detail::deduceAccessMode<Type2, Type3>()>;
2900 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2901 typename Type2,
typename Type3,
typename Type4>
2904 detail::deduceAccessMode<Type3, Type4>()>;
2906 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2907 typename Type2,
typename Type3,
typename Type4,
typename Type5>
2910 detail::deduceAccessMode<Type4, Type5>()>;
2925 #ifdef __SYCL_DEVICE_ONLY__
2933 return hash<decltype(AccImplPtr)>()(AccImplPtr);
2938 template <
typename DataT,
int Dimensions, sycl::access_mode AccessMode>
2943 #ifdef __SYCL_DEVICE_ONLY__
2950 return hash<decltype(AccImplPtr)>()(AccImplPtr);
2955 template <
typename DataT,
int Dimensions>
2956 struct hash<
sycl::local_accessor<DataT, Dimensions>> {
2960 #ifdef __SYCL_DEVICE_ONLY__
2967 return hash<decltype(AccImplPtr)>()(AccImplPtr);
The file contains implementation of accessor iterator class.
local_ptr< DataT > get_pointer() const
Defines a shared array that can be used by kernels in queues.
range< 3 > & getMemoryRange()
bool isPlaceholder() const
range< 3 > & getAccessRange()
AccessorBaseHost(const AccessorImplPtr &Impl)
bool isMemoryObjectUsedByGraph() const
AccessorImplDevice(id< Dims > Offset, range< Dims > AccessRange, range< Dims > MemoryRange)
bool operator==(const AccessorImplDevice &Rhs) const
range< Dims > AccessRange
AccessorImplDevice()=default
range< Dims > AccessRange
LocalAccessorBaseDevice(sycl::range< Dims > Size)
bool operator==(const LocalAccessorBaseDevice &Rhs) const
LocalAccessorBaseHost(const LocalAccessorImplPtr &Impl)
sycl::range< 3 > & getSize()
LocalAccessorImplPtr impl
std::enable_if_t< CurDims==1 &&IsAccessAtomic, atomic< DataT, AS > > operator[](size_t Index) const
AccessorSubscript(AccType Accessor, size_t Index)
AccessorSubscript(AccType Accessor, id< Dims > IDs)
auto operator[](size_t Index)
constexpr static access::address_space AS
constexpr static bool IsAccessReadWrite
const DataT & ConstRefType
static constexpr bool IsConst
constexpr static bool IsAccessAtomic
constexpr static bool IsHostBuf
constexpr static bool IsHostTask
constexpr static bool IsAccessReadOnly
constexpr static bool IsAccessAnyWrite
constexpr static bool IsPlaceH
detail::const_if_const_AS< AS, DataT > * PtrType
detail::const_if_const_AS< AS, DataT > & RefType
constexpr static bool IsConstantBuf
constexpr static bool IsGlobalBuf
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
Command group handler class.
host_accessor(buffer< T, Dims, AllocatorT > &BufferRef, handler &CommandGroupHandler, mode_tag_t< AccessMode >, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
host_accessor(buffer< T, 1, AllocatorT > &BufferRef, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
host_accessor(buffer< T, Dims, AllocatorT > &BufferRef, handler &CommandGroupHandler, range< Dimensions > AccessRange, id< Dimensions > AccessOffset, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
host_accessor(buffer< T, Dims, AllocatorT > &BufferRef, handler &CommandGroupHandler, range< Dimensions > AccessRange, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
host_accessor(buffer< T, Dims, AllocatorT > &BufferRef, mode_tag_t< AccessMode >, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
bool ext_oneapi_owner_before(const ext::oneapi::detail::weak_object_base< host_accessor > &Other) const noexcept
void __init(typename accessor< DataT, Dimensions, AccessMode, target::host_buffer, access::placeholder::false_t >::ConcreteASPtrType Ptr, range< AdjustedDim > AccessRange, range< AdjustedDim > MemRange, id< AdjustedDim > Offset)
host_accessor(const host_accessor< DataT_, Dimensions, AccessMode > &other)
host_accessor(buffer< T, Dims, AllocatorT > &BufferRef, handler &CommandGroupHandler, range< Dimensions > AccessRange, mode_tag_t< AccessMode >, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
host_accessor(buffer< T, Dims, AllocatorT > &BufferRef, range< Dimensions > AccessRange, id< Dimensions > AccessOffset, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
const host_accessor & operator=(typename AccessorT::value_type &&Other) const
host_accessor(buffer< T, Dims, AllocatorT > &BufferRef, handler &CommandGroupHandler, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
host_accessor(buffer< T, Dims, AllocatorT > &BufferRef, range< Dimensions > AccessRange, id< Dimensions > AccessOffset, mode_tag_t< AccessMode >, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
bool ext_oneapi_owner_before(const host_accessor &Other) const noexcept
host_accessor(buffer< T, Dims, AllocatorT > &BufferRef, handler &CommandGroupHandler, range< Dimensions > AccessRange, id< Dimensions > AccessOffset, mode_tag_t< AccessMode >, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
host_accessor(buffer< T, Dims, AllocatorT > &BufferRef, range< Dimensions > AccessRange, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
host_accessor(buffer< T, Dims, AllocatorT > &BufferRef, range< Dimensions > AccessRange, mode_tag_t< AccessMode >, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
host_accessor(const detail::AccessorImplPtr &Impl)
host_accessor(buffer< T, Dims, AllocatorT > &BufferRef, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
host_accessor(const host_accessor< DataT_, Dimensions, AccessMode_ > &other)
const host_accessor & operator=(const typename AccessorT::value_type &Other) const
frienddecltype(Obj::impl) const & getSyclObjImpl(const Obj &SyclObject)
A unique identifier of an item in an index space.
detail::const_if_const_AS< AS, DataT > & RefType
const range< 3 > & getSize() const
bool operator!=(const local_accessor_base &Rhs) const
AccessorCommonT::template AccessorSubscript< Dims - 1, local_accessor_base< DataT, Dimensions, AccessMode, IsPlaceholder > > operator[](size_t Index) const
local_accessor_base(range< Dimensions > AllocationSize, handler &, const detail::code_location CodeLoc=detail::code_location::current())
range< Dims > get_range() const
local_accessor_base(handler &, const detail::code_location CodeLoc=detail::code_location::current())
typename detail::DecoratedType< DataT, AS >::type * ConcreteASPtrType
typename AccessorCommonT::template AccessorSubscript< Dims, local_accessor_base< DataT, Dimensions, AccessMode, IsPlaceholder > > AccessorSubscript
size_t getLinearIndex(id< Dims > Id) const
local_accessor_base(range< Dimensions > AllocationSize, handler &, const property_list &propList, const detail::code_location CodeLoc=detail::code_location::current())
local_accessor_base(handler &, const property_list &propList, const detail::code_location CodeLoc=detail::code_location::current())
bool operator==(const local_accessor_base &Rhs) const
const DataT & const_reference
__SYCL2020_DEPRECATED("get_count() is deprecated, please use size() instead") size_t get_count() const
detail::const_if_const_AS< AS, DataT > * PtrType
size_t size() const noexcept
std::enable_if_t< Dims==1 &&AccessMode==access::mode::atomic, atomic< DataT, AS > > operator[](size_t Index) const
RefType operator[](id< Dimensions > Index) const
PtrType getQualifiedPtr() const
local_accessor_base(const detail::LocalAccessorImplPtr &Impl)
Objects of the property_list class are containers for the SYCL properties.
Defines the iteration domain of either a single work-group in a parallel dispatch,...
#define __SYCL_SPECIAL_CLASS
class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor< DataT
Image accessors.
class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor accessor(buffer< DataT, Dimensions, AllocatorT >) -> accessor< DataT, Dimensions, access::mode::read_write, target::device, access::placeholder::true_t >
Buffer accessor.
decltype(Obj::impl) const & getSyclObjImpl(const Obj &SyclObject)
void addHostAccessorAndWait(AccessorImplHost *Req)
device getDeviceFromHandler(handler &CommandGroupHandlerRef)
size_t getLinearIndex(const T< Dims > &Index, const U< Dims > &Range)
sycl::range< 1 > GetZeroDimAccessRange(BufferT Buffer)
constexpr access::mode accessModeFromConstness()
typename std::is_same< ext::oneapi::accessor_property_list<>, T > IsRunTimePropertyListT
void constructorNotification(void *BufferObj, void *AccessorObj, access::target Target, access::mode Mode, const code_location &CodeLoc)
T createSyclObjFromImpl(decltype(T::impl) ImplObj)
std::shared_ptr< LocalAccessorImplHost > LocalAccessorImplPtr
struct __SYCL2020_DEPRECATED("This type isn't device copyable in SYCL 2020") IsDeprecatedDeviceCopyable< T
constexpr access::target deduceAccessTarget(access::target defaultTarget)
typename std::is_base_of< PropertyListBase, T > IsPropertyListT
constexpr access::mode deduceAccessMode()
constexpr register_alloc_mode_key::value_t< Mode > register_alloc_mode __SYCL_DEPRECATED("register_alloc_mode is deprecated, " "use sycl::ext::intel::experimental::grf_size or " "sycl::ext::intel::experimental::grf_size_automatic")
void associateWithHandler(handler &, AccessorBaseHost *, access::target)
std::shared_ptr< AccessorImplHost > AccessorImplPtr
constexpr buffer_location_key::value_t< N > buffer_location
bool operator==(const cache_config &lhs, const cache_config &rhs)
bool operator!=(const cache_config &lhs, const cache_config &rhs)
decltype(weak_object_base< SYCLObjT >::MObjWeakPtr) getSyclWeakObjImpl(const weak_object_base< SYCLObjT > &WeakObj)
static constexpr bool has_property()
sycl::ext::oneapi::experimental::annotated_ref< T, property_list_t > reference
static constexpr auto get_property()
T & operator[](std::ptrdiff_t idx) const noexcept
host_accessor(buffer< DataT, Dimensions, AllocatorT >) -> host_accessor< DataT, Dimensions, access::mode::read_write >
class __SYCL_EBO __SYCL_SPECIAL_CLASS Dimensions
multi_ptr< ElementType, access::address_space::global_space, IsDecorated > global_ptr
return(x >> one)+(y >> one)+((y &x) &one)
constexpr mode_tag_t< access_mode::read_write > read_write
std::ptrdiff_t difference_type
class __SYCL_EBO __SYCL_SPECIAL_CLASS IsPlaceholder
PropertyListT int access::address_space multi_ptr & operator=(multi_ptr &&)=default
accessor(buffer< DataT, Dimensions, AllocatorT >, handler &, Type1, Type2, Type3, Type4, const ext::oneapi::accessor_property_list< PropsT... > &) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type3, Type4 >(), detail::deduceAccessTarget< Type3, Type4 >(target::device), access::placeholder::false_t, ext::oneapi::accessor_property_list< PropsT... >>
class __SYCL_EBO __SYCL_SPECIAL_CLASS AccessMode
std::error_code make_error_code(sycl::errc E) noexcept
Constructs an error code using e and sycl_category()
multi_ptr< ElementType, access::address_space::local_space, IsDecorated > local_ptr
static size_t get_offset(sycl::id< 3 > id, size_t slice, size_t pitch)
_Abi const simd< _Tp, _Abi > & noexcept
size_t operator()(const AccType &A) const
size_t operator()(const AccType &A) const
size_t operator()(const AccType &A) const
sycl::range< 3 > MMemoryRange
sycl::range< 3 > MAccessRange
AccHostDataT(const sycl::id< 3 > &Offset, const sycl::range< 3 > &Range, const sycl::range< 3 > &MemoryRange, void *Data=nullptr)
constexpr static bool value
static constexpr code_location current(const char *fileName=__CODELOC_FILE_NAME, const char *funcName=__CODELOC_FUNCTION, unsigned long lineNo=__CODELOC_LINE, unsigned long columnNo=__CODELOC_COLUMN) noexcept