46 #ifdef __SYCL_DEVICE_ONLY__
58 #include <type_traits>
234 inline namespace _V1 {
236 namespace ext::intel::esimd::detail {
238 class AccessorPrivateProxy;
271 void *ImageObj,
void *AccessorObj,
273 const void *Type, uint32_t ElemSize,
const code_location &CodeLoc);
276 void *ImageObj,
void *AccessorObj,
277 const std::optional<image_target> &Target,
const void *Type,
280 template <
typename T>
283 template <
typename T>
285 typename std::is_same<ext::oneapi::accessor_property_list<>, T>;
288 constexpr
static bool value =
false;
291 template <
typename... Props>
297 constexpr
static bool value =
false;
302 template <
typename BufferT>
304 return std::min(Buffer.size(),
size_t{1});
316 constexpr
static bool IsHostBuf = AccessTarget == access::target::host_buffer;
334 AccessTarget == access::target::global_buffer;
337 AccessTarget == access::target::constant_buffer;
346 static constexpr
bool IsConst = std::is_const_v<DataT>;
359 template <
int SubDims,
379 template <
int CurDims = SubDims,
typename = std::enable_if_t<(CurDims > 1)>>
381 MIDs[Dims - CurDims] = Index;
385 template <
int CurDims = SubDims,
389 MIDs[Dims - CurDims] = Index;
390 return MAccessor[MIDs];
393 template <
int CurDims = SubDims>
394 typename std::enable_if_t<CurDims == 1 && IsAccessAtomic, atomic<DataT, AS>>
396 MIDs[Dims - CurDims] = Index;
397 return MAccessor[MIDs];
403 if constexpr (std::is_const_v<DataT>)
409 template <
typename MayBeTag1,
typename MayBeTag2>
424 if constexpr (std::is_same_v<
427 access::target::constant_buffer>> ||
431 access::target::constant_buffer>>) {
435 if constexpr (std::is_same_v<MayBeTag1,
438 std::is_same_v<MayBeTag2,
444 if constexpr (std::is_same_v<MayBeTag1,
447 std::is_same_v<MayBeTag2,
456 template <
typename MayBeTag1,
typename MayBeTag2>
458 if constexpr (std::is_same_v<
461 access::target::constant_buffer>> ||
465 access::target::constant_buffer>>) {
466 return access::target::constant_buffer;
485 return defaultTarget;
526 class AccessorImplHost;
542 int ElemSize,
int OffsetInBytes = 0,
543 bool IsSubBuffer =
false,
548 int ElemSize,
bool IsPlaceH,
int OffsetInBytes = 0,
549 bool IsSubBuffer =
false,
554 int ElemSize,
size_t OffsetInBytes = 0,
555 bool IsSubBuffer =
false,
558 AccessorBaseHost(id<3> Offset, range<3> AccessRange, range<3> MemoryRange,
560 int ElemSize,
bool IsPlaceH,
size_t OffsetInBytes = 0,
561 bool IsSubBuffer =
false,
562 const property_list &PropertyList = {});
566 range<3> &getAccessRange();
567 range<3> &getMemoryRange();
569 unsigned int getElemSize() const;
571 const
id<3> &getOffset() const;
572 const range<3> &getAccessRange() const;
573 const range<3> &getMemoryRange() const;
576 bool isMemoryObjectUsedByGraph() const;
578 detail::AccHostDataT &getAccData();
580 const property_list &getPropList() const;
582 void *getMemoryObject() const;
597 friend class
sycl::ext::intel::esimd::detail::AccessorPrivateProxy;
613 void *getPtr()
const;
615 int getElementSize();
631 std::shared_ptr<UnsampledImageAccessorImplHost>;
633 std::shared_ptr<SampledImageAccessorImplHost>;
647 void *SYCLMemObject,
int Dims,
int ElemSize,
652 void *getMemoryObject()
const;
655 void *getPtr()
const;
656 int getNumOfDims()
const;
657 int getElementSize()
const;
658 id<3> getPitch()
const;
675 const auto *this_const =
this;
677 (void)this_const->getSize();
679 (void)this_const->getPtr();
683 #ifndef __SYCL_DEVICE_ONLY__
687 template <
typename DataT,
typename CoordT>
692 return imageReadSamplerHostImpl<CoordT, DataT>(
693 Coords, Smpl, getSize(), getPitch(), getChannelType(),
694 getChannelOrder(), getPtr(), getElementSize());
700 template <
typename DataT,
typename CoordT>
701 void write(
const CoordT &Coords,
const DataT &Color)
const {
703 getChannelType(), getChannelOrder(), getPtr());
715 int Dims,
int ElemSize,
id<3> Pitch,
721 void *getMemoryObject()
const;
724 void *getPtr()
const;
725 int getNumOfDims()
const;
726 int getElementSize()
const;
727 id<3> getPitch()
const;
745 const auto *this_const =
this;
747 (void)this_const->getSize();
749 (void)this_const->getPtr();
753 #ifndef __SYCL_DEVICE_ONLY__
757 template <
typename DataT,
typename CoordT>
758 DataT
read(
const CoordT &Coords)
const {
759 return imageReadSamplerHostImpl<CoordT, DataT>(
760 Coords, getSampler(), getSize(), getPitch(), getChannelType(),
761 getChannelOrder(), getPtr(), getElementSize());
784 constexpr
static bool value = std::is_same_v<T, int>;
787 constexpr
static bool value = std::is_same_v<T, int2>;
790 constexpr
static bool value = std::is_same_v<T, int4>;
795 constexpr
static bool value = std::is_same_v<T, float>;
798 constexpr
static bool value = std::is_same_v<T, float2>;
801 constexpr
static bool value = std::is_same_v<T, float4>;
812 #ifndef __SYCL_DEVICE_ONLY__
822 OCLImageTy MImageObj;
828 void imageAccessorInit(OCLImageTy Image) { MImageObj = Image; }
832 template <
typename T1,
int T2, access::mode T3, access::placeholder T4>
835 constexpr
static bool IsHostImageAcc =
840 constexpr
static bool IsImageArrayAcc =
843 constexpr
static bool IsImageAccessWriteOnly =
847 constexpr
static bool IsImageAccessAnyWrite =
850 constexpr
static bool IsImageAccessReadOnly =
853 constexpr
static bool IsImageAccessAnyRead =
860 "The data type of an image accessor must be only cl_int4, "
861 "cl_uint4, cl_float4 or cl_half4 from SYCL namespace");
863 static_assert(IsImageAcc || IsHostImageAcc || IsImageArrayAcc,
864 "Expected image type");
867 "Expected false as Placeholder value for image accessor.");
870 ((IsImageAcc || IsImageArrayAcc) &&
871 (IsImageAccessWriteOnly || IsImageAccessReadOnly)) ||
872 (IsHostImageAcc && (IsImageAccessAnyWrite || IsImageAccessAnyRead)),
873 "Access modes can be only read/write/discard_write for image/image_array "
874 "target accessor, or they can be only "
875 "read/write/discard_write/read_write for host_image target accessor.");
878 "Dimensions can be 1/2/3 for image accessor.");
880 #ifdef __SYCL_DEVICE_ONLY__
883 return __invoke_ImageQuerySize<sycl::vec<int, Dimensions>, OCLImageTy>(
887 size_t getElementSize()
const {
888 int ChannelType = __invoke_ImageQueryFormat<int, OCLImageTy>(MImageObj);
889 int ChannelOrder = __invoke_ImageQueryOrder<int, OCLImageTy>(MImageObj);
890 int ElementSize = getSPIRVElementSize(ChannelType, ChannelOrder);
900 "image::getRangeInternal() is not implemented for host");
906 #ifndef __SYCL_DEVICE_ONLY__
912 friend class sycl::ext::intel::esimd::detail::AccessorPrivateProxy;
914 #ifdef __SYCL_DEVICE_ONLY__
915 const OCLImageTy getNativeImageObj()
const {
return MImageObj; }
925 #ifdef __SYCL_DEVICE_ONLY__
935 typename = std::enable_if_t<(Dims > 0 && Dims <= 3) && IsHostImageAcc>>
937 #ifdef __SYCL_DEVICE_ONLY__
940 (void)ImageElementSize;
946 detail::convertToArrayOfN<3, 1>(ImageRef.
get_range()),
947 detail::convertToArrayOfN<3, 1>(ImageRef.
get_range()),
950 MImageCount(ImageRef.
size()),
951 MImgChannelOrder(ImageRef.getChannelOrder()),
952 MImgChannelType(ImageRef.getChannelType()) {
961 template <
typename AllocatorT,
int Dims =
Dimensions,
962 typename = std::enable_if_t<(Dims > 0 && Dims <= 3) && IsImageAcc>>
964 handler &CommandGroupHandlerRef,
int ImageElementSize)
965 #ifdef __SYCL_DEVICE_ONLY__
968 (void)CommandGroupHandlerRef;
969 (void)ImageElementSize;
975 detail::convertToArrayOfN<3, 1>(ImageRef.
get_range()),
976 detail::convertToArrayOfN<3, 1>(ImageRef.
get_range()),
979 MImageCount(ImageRef.
size()),
980 MImgChannelOrder(ImageRef.getChannelOrder()),
981 MImgChannelType(ImageRef.getChannelType()) {
984 if (!Device.
has(aspect::ext_intel_legacy_image))
986 sycl::errc::feature_not_supported,
987 "SYCL 1.2.1 images are not supported by this device.");
995 #ifndef __SYCL_DEVICE_ONLY__
1014 #ifdef __SYCL_DEVICE_ONLY__
1017 size_t get_count()
const {
return size(); }
1018 size_t size() const
noexcept {
return get_range<Dimensions>().size(); }
1020 template <
int Dims = Dimensions,
typename = std::enable_if_t<Dims == 1>>
1022 int Range = getRangeInternal();
1025 template <
int Dims = Dimensions,
typename = std::enable_if_t<Dims == 2>>
1026 range<2> get_range()
const {
1027 int2 Range = getRangeInternal();
1028 return range<2>(Range[0], Range[1]);
1030 template <
int Dims = Dimensions,
typename = std::enable_if_t<Dims == 3>>
1031 range<3> get_range()
const {
1032 int3 Range = getRangeInternal();
1033 return range<3>(Range[0], Range[1], Range[2]);
1038 size_t get_count()
const {
return size(); };
1041 template <
int Dims = Dimensions,
typename = std::enable_if_t<(Dims > 0)>>
1043 return detail::convertToArrayOfN<Dims, 1>(getAccessRange());
1052 template <
typename CoordT,
int Dims =
Dimensions,
1053 typename = std::enable_if_t<
1055 (detail::is_genint_v<CoordT>)&&(
1056 (IsImageAcc && IsImageAccessReadOnly) ||
1057 (IsHostImageAcc && IsImageAccessAnyRead))>>
1058 DataT
read(
const CoordT &Coords)
const {
1059 #ifdef __SYCL_DEVICE_ONLY__
1060 return __invoke__ImageRead<DataT, OCLImageTy, CoordT>(MImageObj, Coords);
1064 return read<CoordT, Dims>(Coords, Smpl);
1072 template <
typename CoordT,
int Dims =
Dimensions,
1073 typename = std::enable_if_t<
1075 ((IsImageAcc && IsImageAccessReadOnly) ||
1076 (IsHostImageAcc && IsImageAccessAnyRead))>>
1077 DataT
read(
const CoordT &Coords,
const sampler &Smpl)
const {
1078 #ifdef __SYCL_DEVICE_ONLY__
1079 return __invoke__ImageReadSampler<DataT, OCLImageTy, CoordT>(
1080 MImageObj, Coords, Smpl.impl.m_Sampler);
1082 return imageReadSamplerHostImpl<CoordT, DataT>(
1083 Coords, Smpl, getAccessRange() ,
1084 getOffset() , MImgChannelType, MImgChannelOrder,
1098 typename = std::enable_if_t<(Dims > 0) &&
1099 (detail::is_genint_v<CoordT>)&&(
1101 ((IsImageAcc && IsImageAccessWriteOnly) ||
1102 (IsHostImageAcc && IsImageAccessAnyWrite))>>
1103 void write(
const CoordT &Coords,
const DataT &Color)
const {
1104 #ifdef __SYCL_DEVICE_ONLY__
1105 __invoke__ImageWrite<OCLImageTy, CoordT, DataT>(MImageObj, Coords, Color);
1120 "Image slice cannot have more then 2 dimensions");
1124 template <
typename CoordT,
typename CoordElemType = get_elem_type_t<CoordT>>
1126 getAdjustedCoords(
const CoordT &Coords)
const {
1127 CoordElemType LastCoord = 0;
1129 if (std::is_same<float, CoordElemType>::value) {
1132 MIdx /
static_cast<float>(Size.template swizzle<Dimensions>());
1140 return AdjustedCoords;
1149 : MBaseAcc(BaseAcc), MIdx(Idx) {}
1151 template <
typename CoordT,
int Dims =
Dimensions,
1152 typename = std::enable_if_t<
1154 DataT
read(
const CoordT &Coords)
const {
1155 return MBaseAcc.read(getAdjustedCoords(Coords));
1158 template <
typename CoordT,
int Dims =
Dimensions,
1159 typename = std::enable_if_t<(Dims > 0) &&
1161 DataT
read(
const CoordT &Coords,
const sampler &Smpl)
const {
1162 return MBaseAcc.read(getAdjustedCoords(Coords), Smpl);
1165 template <
typename CoordT,
int Dims =
Dimensions,
1166 typename = std::enable_if_t<(Dims > 0) &&
1168 void write(
const CoordT &Coords,
const DataT &Color)
const {
1169 return MBaseAcc.write(getAdjustedCoords(Coords), Color);
1172 #ifdef __SYCL_DEVICE_ONLY__
1174 size_t get_count()
const {
return size(); }
1175 size_t size() const
noexcept {
return get_range<Dimensions>().size(); }
1177 template <
int Dims = Dimensions,
typename = std::enable_if_t<Dims == 1>>
1179 int2 Count = MBaseAcc.getRangeInternal();
1182 template <
int Dims = Dimensions,
typename = std::enable_if_t<Dims == 2>>
1183 range<2> get_range()
const {
1184 int3 Count = MBaseAcc.getRangeInternal();
1185 return range<2>(Count.x(), Count.y());
1191 size_t get_count()
const {
return size(); }
1193 return MBaseAcc.MImageCount / MBaseAcc.getAccessRange()[
Dimensions];
1197 typename = std::enable_if_t<(Dims == 1 || Dims == 2)>>
1199 return detail::convertToArrayOfN<Dims, 1>(MBaseAcc.getAccessRange());
1220 typename PropertyListT>
1222 #ifndef __SYCL_DEVICE_ONLY__
1223 public detail::AccessorBaseHost,
1225 public detail::accessor_common<DataT, Dimensions, AccessMode, AccessTarget,
1226 IsPlaceholder, PropertyListT>,
1227 public detail::OwnerLessBase<
1228 accessor<DataT, Dimensions, AccessMode, AccessTarget, IsPlaceholder,
1231 static_assert((AccessTarget == access::target::global_buffer ||
1232 AccessTarget == access::target::constant_buffer ||
1233 AccessTarget == access::target::host_buffer ||
1235 "Expected buffer type");
1237 static_assert((AccessTarget == access::target::global_buffer ||
1238 AccessTarget == access::target::host_buffer ||
1240 (AccessTarget == access::target::constant_buffer &&
1242 "Access mode can be only read for constant buffers");
1244 static_assert(detail::IsPropertyListT<PropertyListT>::value,
1245 "PropertyListT must be accessor_property_list");
1247 using AccessorCommonT =
1253 using AccessorCommonT::AS;
1256 static constexpr
bool IsAccessAnyWrite = AccessorCommonT::IsAccessAnyWrite;
1257 static constexpr
bool IsAccessReadOnly = AccessorCommonT::IsAccessReadOnly;
1258 static constexpr
bool IsConstantBuf = AccessorCommonT::IsConstantBuf;
1259 static constexpr
bool IsGlobalBuf = AccessorCommonT::IsGlobalBuf;
1260 static constexpr
bool IsHostBuf = AccessorCommonT::IsHostBuf;
1261 static constexpr
bool IsPlaceH = AccessorCommonT::IsPlaceH;
1262 static constexpr
bool IsConst = AccessorCommonT::IsConst;
1263 static constexpr
bool IsHostTask = AccessorCommonT::IsHostTask;
1265 using AccessorSubscript =
1266 typename AccessorCommonT::template AccessorSubscript<Dims>;
1269 !IsConst || IsAccessReadOnly,
1270 "A const qualified DataT is only allowed for a read-only accessor");
1272 using ConcreteASPtrType =
typename detail::DecoratedType<
1273 typename std::conditional_t<IsAccessReadOnly && !IsConstantBuf,
1274 const DataT, DataT>,
1277 using RefType = detail::const_if_const_AS<AS, DataT> &;
1278 using ConstRefType =
const DataT &;
1279 using PtrType = detail::const_if_const_AS<AS, DataT> *;
1284 detail::loop<Dims>([&,
this](
size_t I) {
1285 Result = Result * getMemoryRange()[I] + Id[I];
1288 #ifndef __SYCL_DEVICE_ONLY__
1291 Result += getOffset()[I];
1299 template <
typename T,
int Dims>
1300 struct IsSameAsBuffer
1301 : std::bool_constant<std::is_same_v<T, DataT> && (Dims > 0) &&
1302 (Dims == Dimensions)> {};
1304 static access::mode getAdjustedMode(
const PropertyListT &PropertyList) {
1307 if (PropertyList.template has_property<property::no_init>() ||
1308 PropertyList.template has_property<property::noinit>()) {
1316 return AdjustedMode;
1319 template <
typename TagT>
1322 std::is_same<TagT, mode_tag_t<AccessMode>>,
1323 std::is_same<TagT, mode_target_tag_t<AccessMode, AccessTarget>>> {};
1325 template <
typename DataT_,
int Dimensions_,
access::mode AccessMode_,
1327 typename PropertyListT_>
1330 #ifdef __SYCL_DEVICE_ONLY__
1332 id<AdjustedDim> &getOffset() {
return impl.Offset; }
1333 range<AdjustedDim> &getAccessRange() {
return impl.AccessRange; }
1334 range<AdjustedDim> &getMemoryRange() {
return impl.MemRange; }
1336 const id<AdjustedDim> &getOffset()
const {
return impl.Offset; }
1337 const range<AdjustedDim> &getAccessRange()
const {
return impl.AccessRange; }
1338 const range<AdjustedDim> &getMemoryRange()
const {
return impl.MemRange; }
1340 detail::AccessorImplDevice<AdjustedDim> impl;
1343 ConcreteASPtrType MData;
1346 void __init(ConcreteASPtrType Ptr, range<AdjustedDim> AccessRange,
1347 range<AdjustedDim> MemRange, id<AdjustedDim> Offset) {
1349 detail::loop<AdjustedDim>([&,
this](
size_t I) {
1352 getOffset()[I] = Offset[I];
1354 getAccessRange()[I] = AccessRange[I];
1355 getMemoryRange()[I] = MemRange[I];
1360 MData += getTotalOffset();
1366 void __init_esimd(ConcreteASPtrType Ptr) {
1368 #ifdef __ESIMD_FORCE_STATELESS_MEM
1369 detail::loop<AdjustedDim>([&,
this](
size_t I) {
1371 getAccessRange()[I] = 0;
1372 getMemoryRange()[I] = 0;
1377 ConcreteASPtrType getQualifiedPtr() const
noexcept {
return MData; }
1379 #ifndef __SYCL_DEVICE_ONLY__
1386 : impl({}, detail::InitializedVal<AdjustedDim, range>::template get<0>(),
1387 detail::InitializedVal<AdjustedDim, range>::template get<0>()) {}
1391 : detail::AccessorBaseHost{Impl} {}
1395 const id<3> getOffset()
const {
1396 if constexpr (IsHostBuf)
1397 return MAccData ? MAccData->MOffset : id<3>();
1401 const range<3> &getAccessRange()
const {
1404 const range<3> getMemoryRange()
const {
1405 if constexpr (IsHostBuf)
1406 return MAccData ? MAccData->MMemoryRange : range(0, 0, 0);
1413 void initHostAcc() { MAccData = &getAccData(); }
1416 void GDBMethodsAnchor() {
1418 const auto *this_const =
this;
1419 (void)getMemoryRange();
1420 (void)this_const->getMemoryRange();
1422 (void)this_const->getOffset();
1424 (void)this_const->getPtr();
1425 (void)getAccessRange();
1426 (void)this_const->getAccessRange();
1430 detail::AccHostDataT *MAccData =
nullptr;
1432 char padding[
sizeof(detail::AccessorImplDevice<AdjustedDim>) +
1433 sizeof(PtrType) -
sizeof(detail::AccessorBaseHost) -
1436 PtrType getQualifiedPtr() const
noexcept {
1437 if constexpr (IsHostBuf)
1438 return MAccData ?
reinterpret_cast<PtrType
>(MAccData->MData) :
nullptr;
1446 {0, 0, 0}, {0, 0, 0},
1448 getAdjustedMode({}),
1453 template <
typename,
int, access_mode>
friend class host_accessor;
1458 friend class sycl::stream;
1459 friend class sycl::ext::intel::esimd::detail::AccessorPrivateProxy;
1461 template <
class Obj>
1472 std::conditional_t<AccessMode == access_mode::read, const DataT, DataT>;
1474 using const_reference =
const DataT &;
1476 template <access::decorated IsDecorated>
1477 using accessor_ptr =
1479 global_ptr<value_type, IsDecorated>,
value_type *>;
1481 using iterator =
typename detail::accessor_iterator<value_type, AdjustedDim>;
1482 using const_iterator =
1483 typename detail::accessor_iterator<const value_type, AdjustedDim>;
1484 using reverse_iterator = std::reverse_iterator<iterator>;
1485 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
1488 using size_type = std::size_t;
1492 void throwIfUsedByGraph()
const {
1493 #ifndef __SYCL_DEVICE_ONLY__
1496 "Host accessors cannot be created for buffers "
1497 "which are currently in use by a command graph.");
1527 template <
typename DataT_,
1528 typename = std::enable_if_t<
1529 IsAccessReadOnly && !std::is_same_v<DataT_, DataT> &&
1530 std::is_same_v<std::remove_const_t<DataT_>,
1531 std::remove_const_t<DataT>>>>
1534 #ifdef __SYCL_DEVICE_ONLY__
1535 : impl(other.impl), MData(other.MData) {
1544 typename = std::enable_if_t<
1546 std::is_same_v<std::remove_const_t<DataT_>,
1547 std::remove_const_t<DataT>>>>
1550 #ifdef __SYCL_DEVICE_ONLY__
1551 : impl(other.impl), MData(other.MData) {
1557 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1558 typename std::enable_if_t<
1559 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1560 std::is_same_v<T, DataT> && Dims == 0 &&
1561 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))> * =
1564 buffer<T, 1, AllocatorT> &BufferRef,
1565 const property_list &PropertyList = {},
1567 #ifdef __SYCL_DEVICE_ONLY__
1569 BufferRef.get_range()) {
1575 detail::convertToArrayOfN<3, 1>(
1577 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1578 getAdjustedMode(PropertyList),
1580 IsPlaceH, BufferRef.OffsetInBytes, BufferRef.IsSubBuffer,
1582 throwIfUsedByGraph();
1583 preScreenAccessor(PropertyList);
1594 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1595 typename... PropTypes,
1596 typename std::enable_if_t<
1600 std::is_same<T, DataT>::value && Dims == 0 &&
1601 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))> * =
1604 buffer<T, 1, AllocatorT> &BufferRef,
1605 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1608 #ifdef __SYCL_DEVICE_ONLY__
1610 BufferRef.get_range()) {
1616 detail::convertToArrayOfN<3, 1>(
1618 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1619 getAdjustedMode(PropertyList),
1621 IsPlaceH, BufferRef.OffsetInBytes, BufferRef.IsSubBuffer,
1623 throwIfUsedByGraph();
1624 preScreenAccessor(PropertyList);
1635 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1636 typename =
typename std::enable_if_t<
1637 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1638 std::is_same_v<T, DataT> && (Dims == 0) &&
1639 (IsGlobalBuf || IsHostBuf || IsConstantBuf || IsHostTask)>>
1641 buffer<T, 1, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1642 const property_list &PropertyList = {},
1644 #ifdef __SYCL_DEVICE_ONLY__
1646 BufferRef.get_range()) {
1647 (void)CommandGroupHandler;
1654 detail::convertToArrayOfN<3, 1>(
1656 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1657 getAdjustedMode(PropertyList),
1659 BufferRef.OffsetInBytes, BufferRef.IsSubBuffer, PropertyList) {
1660 throwIfUsedByGraph();
1661 preScreenAccessor(PropertyList);
1671 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1672 typename... PropTypes,
1673 typename =
typename std::enable_if_t<
1675 std::is_same_v<T, DataT> && (Dims == 0) &&
1676 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1678 buffer<T, 1, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1679 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1682 #ifdef __SYCL_DEVICE_ONLY__
1684 BufferRef.get_range()) {
1685 (void)CommandGroupHandler;
1692 detail::convertToArrayOfN<3, 1>(
1694 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1695 getAdjustedMode(PropertyList),
1697 BufferRef.OffsetInBytes, BufferRef.IsSubBuffer, PropertyList) {
1698 throwIfUsedByGraph();
1699 preScreenAccessor(PropertyList);
1709 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1710 typename = std::enable_if_t<
1711 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1712 IsSameAsBuffer<T, Dims>::value &&
1713 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>>
1715 buffer<T, Dims, AllocatorT> &BufferRef,
1716 const property_list &PropertyList = {},
1718 #ifdef __SYCL_DEVICE_ONLY__
1719 : impl(id<Dimensions>(), BufferRef.get_range(), BufferRef.get_range()) {
1726 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1727 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1728 getAdjustedMode(PropertyList),
1730 IsPlaceH, BufferRef.OffsetInBytes, BufferRef.IsSubBuffer,
1732 throwIfUsedByGraph();
1733 preScreenAccessor(PropertyList);
1744 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1745 typename... PropTypes,
1746 typename = std::enable_if_t<
1748 IsSameAsBuffer<T, Dims>::value &&
1749 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>>
1751 buffer<T, Dims, AllocatorT> &BufferRef,
1752 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1755 #ifdef __SYCL_DEVICE_ONLY__
1756 : impl(id<Dimensions>(), BufferRef.get_range(), BufferRef.get_range()) {
1763 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1764 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1765 getAdjustedMode(PropertyList),
1767 IsPlaceH, BufferRef.OffsetInBytes, BufferRef.IsSubBuffer,
1769 throwIfUsedByGraph();
1770 preScreenAccessor(PropertyList);
1781 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1783 typename = std::enable_if_t<
1784 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1785 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1786 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1788 buffer<T, Dims, AllocatorT> &BufferRef, TagT,
1789 const property_list &PropertyList = {},
1791 :
accessor(BufferRef, PropertyList, CodeLoc) {
1792 adjustAccPropsInBuf(BufferRef);
1795 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1796 typename TagT,
typename... PropTypes,
1797 typename = std::enable_if_t<
1799 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1800 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1802 buffer<T, Dims, AllocatorT> &BufferRef, TagT,
1803 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1806 :
accessor(BufferRef, PropertyList, CodeLoc) {
1807 adjustAccPropsInBuf(BufferRef);
1810 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1811 typename = std::enable_if_t<
1812 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1813 IsSameAsBuffer<T, Dims>::value &&
1814 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1816 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1817 const property_list &PropertyList = {},
1819 #ifdef __SYCL_DEVICE_ONLY__
1820 : impl(id<AdjustedDim>(), BufferRef.get_range(), BufferRef.get_range()) {
1821 (void)CommandGroupHandler;
1828 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1829 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1830 getAdjustedMode(PropertyList),
1832 BufferRef.OffsetInBytes, BufferRef.IsSubBuffer, PropertyList) {
1833 throwIfUsedByGraph();
1834 preScreenAccessor(PropertyList);
1844 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1845 typename... PropTypes,
1846 typename = std::enable_if_t<
1848 IsSameAsBuffer<T, Dims>::value &&
1849 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1851 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1852 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1855 #ifdef __SYCL_DEVICE_ONLY__
1856 : impl(id<AdjustedDim>(), BufferRef.get_range(), BufferRef.get_range()) {
1857 (void)CommandGroupHandler;
1864 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1865 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
1866 getAdjustedMode(PropertyList),
1868 BufferRef.OffsetInBytes, BufferRef.IsSubBuffer, PropertyList) {
1869 throwIfUsedByGraph();
1870 preScreenAccessor(PropertyList);
1880 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1882 typename = std::enable_if_t<
1883 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1884 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1885 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1887 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1888 TagT,
const property_list &PropertyList = {},
1890 :
accessor(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {
1891 adjustAccPropsInBuf(BufferRef);
1894 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1895 typename TagT,
typename... PropTypes,
1896 typename = std::enable_if_t<
1898 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1899 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1901 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1903 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1906 :
accessor(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {
1907 adjustAccPropsInBuf(BufferRef);
1910 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1911 typename = std::enable_if_t<
1912 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1913 IsSameAsBuffer<T, Dims>::value &&
1914 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>>
1916 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
1917 const property_list &PropertyList = {},
1919 :
accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {}
1921 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1922 typename... PropTypes,
1923 typename = std::enable_if_t<
1925 IsSameAsBuffer<T, Dims>::value &&
1926 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>>
1928 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
1929 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1932 :
accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {}
1934 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1936 typename = std::enable_if_t<
1937 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1938 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1939 (IsGlobalBuf || IsConstantBuf || IsHostTask)>>
1941 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
1942 TagT,
const property_list &PropertyList = {},
1944 :
accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {
1945 adjustAccPropsInBuf(BufferRef);
1948 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1949 typename TagT,
typename... PropTypes,
1950 typename = std::enable_if_t<
1952 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1953 (IsGlobalBuf || IsConstantBuf || IsHostTask)>>
1955 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
1957 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1960 :
accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {
1961 adjustAccPropsInBuf(BufferRef);
1964 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1965 typename = std::enable_if_t<
1966 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1967 IsSameAsBuffer<T, Dims>::value &&
1968 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1970 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1971 range<Dimensions> AccessRange,
const property_list &PropertyList = {},
1973 :
accessor(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList,
1976 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1977 typename... PropTypes,
1978 typename = std::enable_if_t<
1980 IsSameAsBuffer<T, Dims>::value &&
1981 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1983 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1984 range<Dimensions> AccessRange,
1985 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
1988 :
accessor(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList,
1991 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
1993 typename = std::enable_if_t<
1994 detail::IsRunTimePropertyListT<PropertyListT>::value &&
1995 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
1996 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
1998 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
1999 range<Dimensions> AccessRange, TagT,
2000 const property_list &PropertyList = {},
2002 :
accessor(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList,
2004 adjustAccPropsInBuf(BufferRef);
2007 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2008 typename TagT,
typename... PropTypes,
2009 typename = std::enable_if_t<
2011 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
2012 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
2014 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
2015 range<Dimensions> AccessRange, TagT,
2016 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
2019 :
accessor(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList,
2021 adjustAccPropsInBuf(BufferRef);
2024 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2025 typename = std::enable_if_t<
2026 detail::IsRunTimePropertyListT<PropertyListT>::value &&
2027 IsSameAsBuffer<T, Dims>::value &&
2028 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>>
2030 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
2031 id<Dimensions> AccessOffset,
const property_list &PropertyList = {},
2033 #ifdef __SYCL_DEVICE_ONLY__
2034 : impl(AccessOffset, AccessRange, BufferRef.get_range()) {
2039 : AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset),
2040 detail::convertToArrayOfN<3, 1>(AccessRange),
2041 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
2042 getAdjustedMode(PropertyList),
2044 sizeof(DataT), IsPlaceH, BufferRef.OffsetInBytes,
2045 BufferRef.IsSubBuffer, PropertyList) {
2046 throwIfUsedByGraph();
2047 preScreenAccessor(PropertyList);
2050 if (BufferRef.isOutOfBounds(AccessOffset, AccessRange,
2051 BufferRef.get_range()))
2052 throw sycl::invalid_object_error(
2053 "accessor with requested offset and range would exceed the bounds of "
2055 PI_ERROR_INVALID_VALUE);
2065 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2066 typename... PropTypes,
2067 typename = std::enable_if_t<
2069 IsSameAsBuffer<T, Dims>::value &&
2070 (IsHostBuf || IsHostTask || (IsGlobalBuf || IsConstantBuf))>>
2072 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
2073 id<Dimensions> AccessOffset,
2074 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
2077 #ifdef __SYCL_DEVICE_ONLY__
2078 : impl(AccessOffset, AccessRange, BufferRef.get_range()) {
2083 : AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset),
2084 detail::convertToArrayOfN<3, 1>(AccessRange),
2085 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
2086 getAdjustedMode(PropertyList),
2088 sizeof(DataT), IsPlaceH, BufferRef.OffsetInBytes,
2089 BufferRef.IsSubBuffer, PropertyList) {
2090 throwIfUsedByGraph();
2091 preScreenAccessor(PropertyList);
2094 if (BufferRef.isOutOfBounds(AccessOffset, AccessRange,
2095 BufferRef.get_range()))
2096 throw sycl::invalid_object_error(
2097 "accessor with requested offset and range would exceed the bounds of "
2099 PI_ERROR_INVALID_VALUE);
2109 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2111 typename = std::enable_if_t<
2112 detail::IsRunTimePropertyListT<PropertyListT>::value &&
2113 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
2114 (IsGlobalBuf || IsConstantBuf || IsHostTask)>>
2116 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
2117 id<Dimensions> AccessOffset, TagT,
const property_list &PropertyList = {},
2119 :
accessor(BufferRef, AccessRange, AccessOffset, PropertyList, CodeLoc) {
2120 adjustAccPropsInBuf(BufferRef);
2123 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2124 typename TagT,
typename... PropTypes,
2125 typename = std::enable_if_t<
2127 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
2128 (IsGlobalBuf || IsConstantBuf || IsHostTask)>>
2130 buffer<T, Dims, AllocatorT> &BufferRef, range<Dimensions> AccessRange,
2131 id<Dimensions> AccessOffset, TagT,
2132 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
2135 :
accessor(BufferRef, AccessRange, AccessOffset, PropertyList, CodeLoc) {
2136 adjustAccPropsInBuf(BufferRef);
2139 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2140 typename = std::enable_if_t<
2141 detail::IsRunTimePropertyListT<PropertyListT>::value &&
2142 IsSameAsBuffer<T, Dims>::value &&
2143 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
2145 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
2146 range<Dimensions> AccessRange, id<Dimensions> AccessOffset,
2147 const property_list &PropertyList = {},
2149 #ifdef __SYCL_DEVICE_ONLY__
2150 : impl(AccessOffset, AccessRange, BufferRef.get_range()) {
2151 (void)CommandGroupHandler;
2156 : AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset),
2157 detail::convertToArrayOfN<3, 1>(AccessRange),
2158 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
2159 getAdjustedMode(PropertyList),
2161 sizeof(DataT), BufferRef.OffsetInBytes,
2162 BufferRef.IsSubBuffer, PropertyList) {
2163 throwIfUsedByGraph();
2164 preScreenAccessor(PropertyList);
2165 if (BufferRef.isOutOfBounds(AccessOffset, AccessRange,
2166 BufferRef.get_range()))
2167 throw sycl::invalid_object_error(
2168 "accessor with requested offset and range would exceed the bounds of "
2170 PI_ERROR_INVALID_VALUE);
2181 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2182 typename... PropTypes,
2183 typename = std::enable_if_t<
2185 IsSameAsBuffer<T, Dims>::value &&
2186 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
2188 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
2189 range<Dimensions> AccessRange, id<Dimensions> AccessOffset,
2190 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
2193 #ifdef __SYCL_DEVICE_ONLY__
2194 : impl(AccessOffset, AccessRange, BufferRef.get_range()) {
2195 (void)CommandGroupHandler;
2200 : AccessorBaseHost(detail::convertToArrayOfN<3, 0>(AccessOffset),
2201 detail::convertToArrayOfN<3, 1>(AccessRange),
2202 detail::convertToArrayOfN<3, 1>(BufferRef.get_range()),
2203 getAdjustedMode(PropertyList),
2205 sizeof(DataT), BufferRef.OffsetInBytes,
2206 BufferRef.IsSubBuffer, PropertyList) {
2207 throwIfUsedByGraph();
2208 preScreenAccessor(PropertyList);
2209 if (BufferRef.isOutOfBounds(AccessOffset, AccessRange,
2210 BufferRef.get_range()))
2211 throw sycl::invalid_object_error(
2212 "accessor with requested offset and range would exceed the bounds of "
2214 PI_ERROR_INVALID_VALUE);
2225 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2227 typename = std::enable_if_t<
2228 detail::IsRunTimePropertyListT<PropertyListT>::value &&
2229 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
2230 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
2232 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
2233 range<Dimensions> AccessRange, id<Dimensions> AccessOffset, TagT,
2234 const property_list &PropertyList = {},
2236 :
accessor(BufferRef, CommandGroupHandler, AccessRange, AccessOffset,
2237 PropertyList, CodeLoc) {
2238 adjustAccPropsInBuf(BufferRef);
2241 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
2242 typename TagT,
typename... PropTypes,
2243 typename = std::enable_if_t<
2245 IsSameAsBuffer<T, Dims>::value && IsValidTag<TagT>::value &&
2246 (IsGlobalBuf || IsConstantBuf || IsHostBuf || IsHostTask)>>
2248 buffer<T, Dims, AllocatorT> &BufferRef, handler &CommandGroupHandler,
2249 range<Dimensions> AccessRange, id<Dimensions> AccessOffset, TagT,
2250 const ext::oneapi::accessor_property_list<PropTypes...> &PropertyList =
2253 :
accessor(BufferRef, CommandGroupHandler, AccessRange, AccessOffset,
2254 PropertyList, CodeLoc) {
2255 adjustAccPropsInBuf(BufferRef);
2258 template <
typename... NewPropsT>
2261 ext::oneapi::accessor_property_list<NewPropsT...>> &Other,
2263 #ifdef __SYCL_DEVICE_ONLY__
2264 : impl(Other.impl), MData(Other.MData)
2266 : detail::AccessorBaseHost(Other), MAccData(Other.MAccData)
2270 "Conversion is only available for accessor_property_list");
2272 PropertyListT::template areSameCompileTimeProperties<NewPropsT...>(),
2273 "Compile-time-constant properties must be the same");
2275 #ifndef __SYCL_DEVICE_ONLY__
2281 void swap(accessor &other) {
2282 std::swap(impl, other.impl);
2283 #ifdef __SYCL_DEVICE_ONLY__
2284 std::swap(MData, other.MData);
2286 std::swap(MAccData, other.MAccData);
2290 bool is_placeholder()
const {
2291 #ifdef __SYCL_DEVICE_ONLY__
2298 size_t get_size()
const {
return getAccessRange().size() *
sizeof(DataT); }
2301 size_t get_count()
const {
return size(); }
2302 size_type size() const
noexcept {
return getAccessRange().size(); }
2304 size_type byte_size() const
noexcept {
return size() *
sizeof(DataT); }
2306 size_type max_size() const
noexcept {
2313 typename = std::enable_if_t<Dims ==
Dimensions && (Dims > 0)>>
2314 range<Dimensions> get_range()
const {
2315 return getRange<Dims>();
2319 typename = std::enable_if_t<Dims ==
Dimensions && (Dims > 0)>>
2321 return getOffset<Dims>();
2324 template <
int Dims =
Dimensions,
typename RefT = RefType,
2325 typename = std::enable_if_t<Dims == 0 &&
2326 (IsAccessAnyWrite || IsAccessReadOnly)>>
2329 return *(getQualifiedPtr() + LinearIndex);
2334 !IsAccessReadOnly && Dims == 0>>
2336 *getQualifiedPtr() = Other;
2342 !IsAccessReadOnly && Dims == 0>>
2344 *getQualifiedPtr() = std::move(Other);
2349 typename = std::enable_if_t<(Dims > 0) &&
2350 (IsAccessAnyWrite || IsAccessReadOnly)>>
2353 return getQualifiedPtr()[LinearIndex];
2356 template <
int Dims = Dimensions>
2357 operator typename std::enable_if_t<Dims == 0 &&
2359 #ifdef __ENABLE_USM_ADDR_SPACE__
2366 return atomic<DataT, AS>(multi_ptr<DataT, AS, access::decorated::yes>(
2367 getQualifiedPtr() + LinearIndex));
2370 template <
int Dims = Dimensions>
2373 operator[](id<Dimensions> Index)
const {
2375 return atomic<DataT, AS>(multi_ptr<DataT, AS, access::decorated::yes>(
2376 getQualifiedPtr() + LinearIndex));
2379 template <
int Dims = Dimensions>
2383 const size_t LinearIndex =
getLinearIndex(id<AdjustedDim>(Index));
2384 return atomic<DataT, AS>(multi_ptr<DataT, AS, access::decorated::yes>(
2385 getQualifiedPtr() + LinearIndex));
2387 template <
int Dims = Dimensions,
typename = std::enable_if_t<(Dims > 1)>>
2389 return AccessorSubscript<Dims - 1>(*
this, Index);
2393 typename = std::enable_if_t<
2394 (AccessTarget_ == access::target::host_buffer) ||
2396 std::add_pointer_t<value_type> get_pointer() const
noexcept {
2397 return getPointerAdjusted();
2404 "accessor::get_pointer() is deprecated, please use get_multi_ptr()")
2406 return global_ptr<DataT>(
2407 const_cast<typename detail::DecoratedType<DataT, AS>::type *
>(
2408 getPointerAdjusted()));
2412 typename = std::enable_if_t<AccessTarget_ ==
2413 access::target::constant_buffer>>
2414 constant_ptr<DataT> get_pointer()
const {
2415 return constant_ptr<DataT>(getPointerAdjusted());
2418 template <access::decorated IsDecorated>
2419 accessor_ptr<IsDecorated> get_multi_ptr() const
noexcept {
2420 return accessor_ptr<IsDecorated>(getPointerAdjusted());
2426 template <
typename Property>
2427 typename std::enable_if_t<
2428 !ext::oneapi::is_compile_time_property<Property>::value,
bool>
2430 #ifndef __SYCL_DEVICE_ONLY__
2431 return getPropList().template has_property<Property>();
2440 template <
typename Property,
2441 typename =
typename std::enable_if_t<
2442 !ext::oneapi::is_compile_time_property<Property>::value>>
2444 #ifndef __SYCL_DEVICE_ONLY__
2445 return getPropList().template get_property<Property>();
2451 template <
typename Property>
2453 typename std::enable_if_t<
2454 ext::oneapi::is_compile_time_property<Property>::value> * = 0) {
2455 return PropertyListT::template has_property<Property>();
2458 template <
typename Property>
2460 typename std::enable_if_t<
2461 ext::oneapi::is_compile_time_property<Property>::value> * = 0) {
2462 return PropertyListT::template get_property<Property>();
2465 bool operator==(
const accessor &Rhs)
const {
return impl == Rhs.impl; }
2466 bool operator!=(
const accessor &Rhs)
const {
return !(*
this == Rhs); }
2469 return iterator::getBegin(
2471 detail::convertToArrayOfN<AdjustedDim, 1>(getMemoryRange()),
2472 getRange<AdjustedDim>(), getOffset<AdjustedDim>());
2476 return iterator::getEnd(
2478 detail::convertToArrayOfN<AdjustedDim, 1>(getMemoryRange()),
2479 getRange<AdjustedDim>(), getOffset<AdjustedDim>());
2482 const_iterator cbegin() const
noexcept {
2483 return const_iterator::getBegin(
2485 detail::convertToArrayOfN<AdjustedDim, 1>(getMemoryRange()),
2486 getRange<AdjustedDim>(), getOffset<AdjustedDim>());
2489 const_iterator cend() const
noexcept {
2490 return const_iterator::getEnd(
2492 detail::convertToArrayOfN<AdjustedDim, 1>(getMemoryRange()),
2493 getRange<AdjustedDim>(), getOffset<AdjustedDim>());
2496 reverse_iterator rbegin() const
noexcept {
return reverse_iterator(
end()); }
2497 reverse_iterator rend() const
noexcept {
return reverse_iterator(begin()); }
2499 const_reverse_iterator crbegin() const
noexcept {
2500 return const_reverse_iterator(cend());
2502 const_reverse_iterator crend() const
noexcept {
2503 return const_reverse_iterator(cbegin());
2507 template <
int Dims,
typename = std::enable_if_t<(Dims > 0)>>
2508 range<Dims> getRange()
const {
2509 return detail::convertToArrayOfN<AdjustedDim, 1>(getAccessRange());
2512 template <
int Dims = Dimensions,
typename = std::enable_if_t<(Dims > 0)>>
2513 id<Dims> getOffset()
const {
2517 "Accessor has no_offset property, get_offset() can not be used");
2518 return detail::convertToArrayOfN<Dims, 0>(getOffset());
2521 #ifdef __SYCL_DEVICE_ONLY__
2522 size_t getTotalOffset() const
noexcept {
2523 size_t TotalOffset = 0;
2524 detail::loop<Dimensions>([&,
this](
size_t I) {
2525 TotalOffset = TotalOffset * impl.MemRange[I];
2528 TotalOffset += impl.Offset[I];
2541 auto getPointerAdjusted() const
noexcept {
2542 #ifdef __SYCL_DEVICE_ONLY__
2543 return getQualifiedPtr() - getTotalOffset();
2545 return getQualifiedPtr();
2549 void preScreenAccessor(
const PropertyListT &PropertyList) {
2551 if (PropertyList.template has_property<property::no_init>() &&
2553 throw sycl::invalid_object_error(
2554 "accessor would cannot be both read_only and no_init",
2555 PI_ERROR_INVALID_VALUE);
2559 template <
typename BufT,
typename... PropTypes>
2560 void adjustAccPropsInBuf(BufT &Buffer) {
2566 property_list PropList{
2568 Buffer.addOrReplaceAccessorProperties(PropList);
2570 deleteAccPropsFromBuf(Buffer);
2574 template <
typename BufT>
void deleteAccPropsFromBuf(BufT &Buffer) {
2575 Buffer.deleteAccProps(
2580 template <
typename DataT,
int Dimensions,
typename AllocatorT>
2585 template <
typename DataT,
int Dimensions,
typename AllocatorT,
2593 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1>
2596 detail::deduceAccessTarget<Type1, Type1>(target::device),
2599 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2604 detail::deduceAccessTarget<Type1, Type1>(target::device),
2608 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2612 detail::deduceAccessTarget<Type1, Type2>(target::device),
2615 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2616 typename Type2,
typename... PropsT>
2620 detail::deduceAccessTarget<Type1, Type2>(target::device),
2624 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2625 typename Type2,
typename Type3>
2628 detail::deduceAccessTarget<Type2, Type3>(target::device),
2631 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2632 typename Type2,
typename Type3,
typename... PropsT>
2636 detail::deduceAccessTarget<Type2, Type3>(target::device),
2640 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2641 typename Type2,
typename Type3,
typename Type4>
2644 detail::deduceAccessTarget<Type3, Type4>(target::device),
2647 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2648 typename Type2,
typename Type3,
typename Type4,
typename... PropsT>
2652 detail::deduceAccessTarget<Type3, Type4>(target::device),
2656 template <
typename DataT,
int Dimensions,
typename AllocatorT>
2661 template <
typename DataT,
int Dimensions,
typename AllocatorT,
2669 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1>
2672 detail::deduceAccessTarget<Type1, Type1>(target::device),
2675 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2680 detail::deduceAccessTarget<Type1, Type1>(target::device),
2684 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2688 detail::deduceAccessTarget<Type1, Type2>(target::device),
2691 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2692 typename Type2,
typename... PropsT>
2696 detail::deduceAccessTarget<Type1, Type2>(target::device),
2700 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2701 typename Type2,
typename Type3>
2704 detail::deduceAccessTarget<Type2, Type3>(target::device),
2707 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2708 typename Type2,
typename Type3,
typename... PropsT>
2712 detail::deduceAccessTarget<Type2, Type3>(target::device),
2716 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2717 typename Type2,
typename Type3,
typename Type4>
2721 detail::deduceAccessTarget<Type3, Type4>(target::device),
2724 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
2725 typename Type2,
typename Type3,
typename Type4,
typename... PropsT>
2729 detail::deduceAccessTarget<Type3, Type4>(target::device),
2739 #ifndef __SYCL_DEVICE_ONLY__
2743 access::target::local, IsPlaceholder> {
2751 using AccessorCommonT::AS;
2755 static constexpr
bool IsAccessAnyWrite = AccessorCommonT::IsAccessAnyWrite;
2756 static constexpr
bool IsAccessReadOnly = AccessorCommonT::IsAccessReadOnly;
2757 static constexpr
bool IsConst = AccessorCommonT::IsConst;
2770 #ifdef __SYCL_DEVICE_ONLY__
2779 detail::loop<AdjustedDim>(
2780 [&,
this](
size_t I) { getSize()[I] = AccessRange[I]; });
2786 void __init_esimd(ConcreteASPtrType Ptr) {
2788 detail::loop<AdjustedDim>([&,
this](
size_t I) { getSize()[I] = 0; });
2793 local_accessor_base()
2794 : impl(detail::InitializedVal<AdjustedDim, range>::template
get<0>()) {}
2797 ConcreteASPtrType getQualifiedPtr()
const {
return MData; }
2799 ConcreteASPtrType MData;
2804 : detail::LocalAccessorBaseHost{
sycl::
range<3>{0, 0, 0},
2805 0,
sizeof(DataT)} {}
2809 : detail::LocalAccessorBaseHost{Impl} {}
2829 const auto *this_const =
this;
2831 (void)this_const->getSize();
2833 (void)this_const->getPtr();
2843 [&,
this](
size_t I) { Result = Result * getSize()[I] + Id[I]; });
2847 template <
class Obj>
2860 template <
int Dims = Dimensions,
typename = std::enable_if_t<Dims == 0>>
2863 #ifdef __SYCL_DEVICE_ONLY__
2868 : LocalAccessorBaseHost(
range<3>{1, 1, 1}, AdjustedDim,
sizeof(DataT)) {
2875 template <
int Dims = Dimensions,
typename = std::enable_if_t<Dims == 0>>
2879 #ifdef __SYCL_DEVICE_ONLY__
2885 : LocalAccessorBaseHost(
range<3>{1, 1, 1}, AdjustedDim,
sizeof(DataT),
2893 template <
int Dims = Dimensions,
typename = std::enable_if_t<(Dims > 0)>>
2897 #ifdef __SYCL_DEVICE_ONLY__
2898 : impl(AllocationSize) {
2902 : LocalAccessorBaseHost(detail::convertToArrayOfN<3, 1>(AllocationSize),
2903 AdjustedDim,
sizeof(DataT)) {
2911 typename = std::enable_if_t<(Dims > 0)>>
2916 #ifdef __SYCL_DEVICE_ONLY__
2917 : impl(AllocationSize) {
2922 : LocalAccessorBaseHost(detail::convertToArrayOfN<3, 1>(AllocationSize),
2923 AdjustedDim,
sizeof(DataT), propList) {
2930 size_t get_size()
const {
return getSize().size() *
sizeof(DataT); }
2933 size_t get_count()
const {
return size(); }
2936 template <
int Dims = Dimensions,
typename = std::enable_if_t<(Dims > 0)>>
2938 return detail::convertToArrayOfN<Dims, 1>(getSize());
2942 typename = std::enable_if_t<Dims == 0 &&
2943 (IsAccessAnyWrite || IsAccessReadOnly)>>
2945 return *getQualifiedPtr();
2949 typename = std::enable_if_t<(Dims > 0) &&
2950 (IsAccessAnyWrite || IsAccessReadOnly)>>
2953 return getQualifiedPtr()[LinearIndex];
2957 typename = std::enable_if_t<Dims == 1 &&
2958 (IsAccessAnyWrite || IsAccessReadOnly)>>
2960 return getQualifiedPtr()[Index];
2963 template <
int Dims = Dimensions>
2964 operator typename std::enable_if_t<
2967 return atomic<DataT, AS>(
2971 template <
int Dims = Dimensions>
2977 getQualifiedPtr() + LinearIndex));
2980 template <
int Dims = Dimensions>
2985 getQualifiedPtr() + Index));
2988 template <
int Dims = Dimensions,
typename = std::enable_if_t<(Dims > 1)>>
2989 typename AccessorCommonT::template AccessorSubscript<
2997 return impl == Rhs.
impl;
3000 return !(*
this == Rhs);
3011 accessor<DataT, Dimensions, AccessMode, access::target::local,
3018 !local_acc::IsConst || local_acc::IsAccessReadOnly,
3019 "A const qualified DataT is only allowed for a read-only accessor");
3022 using local_acc::local_acc;
3029 #ifdef __SYCL_DEVICE_ONLY__
3033 void __init(
typename local_acc::ConcreteASPtrType Ptr,
3037 local_acc::__init(Ptr, AccessRange,
range,
id);
3043 void __init_esimd(
typename local_acc::ConcreteASPtrType Ptr) {
3044 local_acc::__init_esimd(Ptr);
3050 local_acc::impl = detail::InitializedVal<local_acc::AdjustedDim,
3051 range>::template get<0>();
3060 template <
typename DataT,
int Dimensions = 1>
3062 :
public local_accessor_base<DataT, Dimensions,
3063 detail::accessModeFromConstness<DataT>(),
3064 access::placeholder::false_t>,
3065 public detail::OwnerLessBase<local_accessor<DataT, Dimensions>> {
3069 detail::accessModeFromConstness<DataT>(),
3073 !local_acc::IsConst || local_acc::IsAccessReadOnly,
3074 "A const qualified DataT is only allowed for a read-only accessor");
3077 using local_acc::local_acc;
3079 #ifdef __SYCL_DEVICE_ONLY__
3083 void __init(
typename local_acc::ConcreteASPtrType Ptr,
3084 range<local_acc::AdjustedDim> AccessRange,
3085 range<local_acc::AdjustedDim> range,
3086 id<local_acc::AdjustedDim>
id) {
3087 local_acc::__init(Ptr, AccessRange, range,
id);
3093 void __init_esimd(
typename local_acc::ConcreteASPtrType Ptr) {
3094 local_acc::__init_esimd(Ptr);
3100 local_acc::impl = detail::InitializedVal<local_acc::AdjustedDim,
3101 range>::template get<0>();
3111 template <
typename DataT_,
3112 typename = std::enable_if_t<
3113 std::is_const_v<DataT> &&
3114 std::is_same_v<DataT_, std::remove_const_t<DataT>>>>
3115 local_accessor(
const local_accessor<DataT_, Dimensions> &other) {
3116 local_acc::impl = other.impl;
3117 #ifdef __SYCL_DEVICE_ONLY__
3118 local_acc::MData = other.MData;
3125 using reverse_iterator = std::reverse_iterator<iterator>;
3126 using const_reverse_iterator = std::reverse_iterator<const_iterator>;
3129 using size_type = std::size_t;
3131 template <access::decorated IsDecorated>
3132 using accessor_ptr = local_ptr<value_type, IsDecorated>;
3134 template <
typename DataT_>
3135 bool operator==(
const local_accessor<DataT_, Dimensions> &Rhs)
const {
3136 return local_acc::impl == Rhs.impl;
3139 template <
typename DataT_>
3140 bool operator!=(
const local_accessor<DataT_, Dimensions> &Rhs)
const {
3141 return !(*
this == Rhs);
3144 void swap(local_accessor &other) { std::swap(this->impl, other.impl); }
3146 size_type byte_size() const
noexcept {
return this->size() *
sizeof(DataT); }
3148 size_type max_size() const
noexcept {
3156 return local_acc::getQualifiedPtr();
3164 return begin() + this->size();
3167 const_iterator cbegin() const
noexcept {
return const_iterator(begin()); }
3168 const_iterator cend() const
noexcept {
return const_iterator(
end()); }
3170 reverse_iterator rbegin() const
noexcept {
return reverse_iterator(
end()); }
3171 reverse_iterator rend() const
noexcept {
return reverse_iterator(begin()); }
3173 const_reverse_iterator crbegin() const
noexcept {
3174 return const_reverse_iterator(
end());
3176 const_reverse_iterator crend() const
noexcept {
3177 return const_reverse_iterator(begin());
3181 "local_accessor::get_pointer() is deprecated, please use get_multi_ptr()")
3183 return local_ptr<DataT>(local_acc::getQualifiedPtr());
3186 template <access::decorated IsDecorated>
3187 accessor_ptr<IsDecorated> get_multi_ptr() const
noexcept {
3188 return accessor_ptr<IsDecorated>(local_acc::getQualifiedPtr());
3192 #ifndef __SYCL_DEVICE_ONLY__
3193 return this->getPropList().template has_property<Property>();
3199 template <
typename Property> Property
get_property()
const {
3200 #ifndef __SYCL_DEVICE_ONLY__
3201 return this->getPropList().template get_property<Property>();
3208 typename = std::enable_if_t<!std::is_const_v<DataT> && Dims == 0>>
3210 *local_acc::getQualifiedPtr() = Other;
3215 typename = std::enable_if_t<!std::is_const_v<DataT> && Dims == 0>>
3217 *local_acc::getQualifiedPtr() = std::move(Other);
3222 friend class sycl::ext::intel::esimd::detail::AccessorPrivateProxy;
3234 :
public detail::image_accessor<DataT, Dimensions, AccessMode,
3235 access::target::image, IsPlaceholder>,
3236 public detail::OwnerLessBase<
3237 accessor<DataT, Dimensions, AccessMode, access::target::image,
3245 template <
typename AllocatorT>
3250 Image, CommandGroupHandler, Image.getElementSize()) {
3251 #ifndef __SYCL_DEVICE_ONLY__
3257 template <
typename AllocatorT>
3262 Image, CommandGroupHandler, Image.getElementSize()) {
3264 #ifndef __SYCL_DEVICE_ONLY__
3269 #ifdef __SYCL_DEVICE_ONLY__
3277 void __init(OCLImageTy Image) { this->imageAccessorInit(Image); }
3280 void __init_esimd(OCLImageTy Image) { this->imageAccessorInit(Image); }
3300 access::target::host_image, IsPlaceholder>,
3302 accessor<DataT, Dimensions, AccessMode, access::target::host_image,
3305 template <
typename AllocatorT>
3309 Image, Image.getElementSize()) {}
3311 template <
typename AllocatorT>
3316 Image, Image.getElementSize()) {
3333 :
public detail::image_accessor<DataT, Dimensions + 1, AccessMode,
3334 access::target::image, IsPlaceholder>,
3335 public detail::OwnerLessBase<
3336 accessor<DataT, Dimensions, AccessMode, access::target::image_array,
3338 #ifdef __SYCL_DEVICE_ONLY__
3346 void __init(OCLImageTy Image) { this->imageAccessorInit(Image); }
3349 void __init_esimd(OCLImageTy Image) { this->imageAccessorInit(Image); }
3356 template <
typename AllocatorT>
3358 handler &CommandGroupHandler)
3361 Image, CommandGroupHandler, Image.getElementSize()) {
3362 #ifndef __SYCL_DEVICE_ONLY__
3368 template <
typename AllocatorT>
3370 handler &CommandGroupHandler,
const property_list &propList)
3373 Image, CommandGroupHandler, Image.getElementSize()) {
3375 #ifndef __SYCL_DEVICE_ONLY__
3381 detail::__image_array_slice__<DataT, Dimensions, AccessMode, IsPlaceholder>
3388 template <
typename DataT,
int Dimensions = 1,
3391 :
public accessor<DataT, Dimensions, AccessMode, target::host_buffer,
3392 access::placeholder::false_t> {
3400 template <
typename T,
int Dims>
3402 : std::bool_constant<std::is_same_v<T, DataT> && (Dims > 0) &&
3403 (Dims == Dimensions)> {};
3410 AccessorT::__init(Ptr, AccessRange, MemRange, Offset);
3413 #ifndef __SYCL_DEVICE_ONLY__
3418 template <
class Obj>
3451 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
3452 typename =
typename std::enable_if_t<std::is_same_v<T, DataT> &&
3458 : AccessorT(BufferRef, PropertyList, CodeLoc) {}
3460 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
3461 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
3466 : AccessorT(BufferRef, PropertyList, CodeLoc) {}
3468 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
3469 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
3476 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
3477 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
3482 : AccessorT(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {}
3484 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
3485 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
3490 :
host_accessor(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {}
3492 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
3493 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
3498 : AccessorT(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {}
3500 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
3501 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
3506 :
host_accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {}
3508 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
3509 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
3514 : AccessorT(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList,
3517 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
3518 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
3524 :
host_accessor(BufferRef, CommandGroupHandler, AccessRange, {},
3525 PropertyList, CodeLoc) {}
3527 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
3528 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
3533 : AccessorT(BufferRef, AccessRange, AccessOffset, PropertyList, CodeLoc) {
3536 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
3537 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
3543 :
host_accessor(BufferRef, AccessRange, AccessOffset, PropertyList,
3546 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
3547 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
3553 : AccessorT(BufferRef, CommandGroupHandler, AccessRange, AccessOffset,
3554 PropertyList, CodeLoc) {}
3556 template <
typename T = DataT,
int Dims =
Dimensions,
typename AllocatorT,
3557 typename = std::enable_if_t<IsSameAsBuffer<T, Dims>::value>>
3563 :
host_accessor(BufferRef, CommandGroupHandler, AccessRange, AccessOffset,
3564 PropertyList, CodeLoc) {}
3568 !IsAccessReadOnly && Dims == 0>>
3571 *AccessorT::getQualifiedPtr() = Other;
3577 !IsAccessReadOnly && Dims == 0>>
3579 *AccessorT::getQualifiedPtr() = std::move(Other);
3584 template <
typename DataT_,
3585 typename = std::enable_if_t<
3586 IsAccessReadOnly && !std::is_same_v<DataT_, DataT> &&
3587 std::is_same_v<std::remove_const_t<DataT_>,
3588 std::remove_const_t<DataT>>>>
3590 #ifndef __SYCL_DEVICE_ONLY__
3592 AccessorT::MAccData = other.MAccData;
3602 typename = std::enable_if_t<
3604 std::is_same_v<DataT_, std::remove_const_t<DataT>>>>
3606 #ifndef __SYCL_DEVICE_ONLY__
3608 AccessorT::MAccData = other.MAccData;
3619 #ifndef __SYCL_DEVICE_ONLY__
3623 return this->impl.owner_before(
3628 return this->impl.owner_before(Other.impl);
3631 bool ext_oneapi_owner_before(
3638 template <
typename DataT,
int Dimensions,
typename AllocatorT>
3642 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1>
3645 detail::deduceAccessMode<Type1, Type1>()>;
3647 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
3651 detail::deduceAccessMode<Type1, Type2>()>;
3653 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
3654 typename Type2,
typename Type3>
3657 detail::deduceAccessMode<Type2, Type3>()>;
3659 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
3660 typename Type2,
typename Type3,
typename Type4>
3663 detail::deduceAccessMode<Type3, Type4>()>;
3665 template <
typename DataT,
int Dimensions,
typename AllocatorT,
typename Type1,
3666 typename Type2,
typename Type3,
typename Type4,
typename Type5>
3669 detail::deduceAccessMode<Type4, Type5>()>;
3676 #ifndef __SYCL_DEVICE_ONLY__
3680 unsampled_image_accessor<DataT, Dimensions, AccessMode, AccessTarget>> {
3681 static_assert(std::is_same_v<DataT, int4> || std::is_same_v<DataT, uint4> ||
3682 std::is_same_v<DataT, float4> ||
3683 std::is_same_v<DataT, half4>,
3684 "The data type of an image accessor must be only int4, "
3685 "uint4, float4 or half4 from SYCL namespace");
3688 "Access mode must be either read or write.");
3690 #ifdef __SYCL_DEVICE_ONLY__
3698 const DataT, DataT>::type;
3702 template <
typename AllocatorT>
3707 #ifdef __SYCL_DEVICE_ONLY__
3710 (void)CommandGroupHandlerRef;
3715 : host_base_class(detail::convertToArrayOfN<3, 1>(ImageRef.
get_range()),
3718 {ImageRef.getRowPitch(), ImageRef.getSlicePitch(), 0},
3723 aspect ImageAspect = aspect::image;
3727 "Device associated with command group handler does not have "
3732 AccessMode, (
const void *)
typeid(DataT).name(),
sizeof(DataT), CodeLoc);
3751 #ifdef __SYCL_DEVICE_ONLY__
3755 return Rhs.impl == impl;
3760 return !(Rhs == *
this);
3765 #ifndef __SYCL_DEVICE_ONLY__
3766 return getPropList().template has_property<Property>();
3772 #ifndef __SYCL_DEVICE_ONLY__
3773 return getPropList().template get_property<Property>();
3780 #ifdef __SYCL_DEVICE_ONLY__
3784 return host_base_class::getSize().size();
3792 template <
typename CoordT,
3797 #ifdef __SYCL_DEVICE_ONLY__
3799 std::ignore = Coords;
3800 return {0, 0, 0, 0};
3802 return host_base_class::read<DataT>(Coords);
3810 template <
typename CoordT,
3814 void write(
const CoordT &Coords,
const DataT &Color)
const {
3815 #ifdef __SYCL_DEVICE_ONLY__
3817 std::ignore = Coords;
3818 std::ignore = Color;
3820 host_base_class::write<DataT>(Coords, Color);
3826 #ifndef __SYCL_DEVICE_ONLY__
3827 : host_base_class{Impl}
3833 template <
class Obj>
3840 template <
typename DataT,
int Dimensions = 1,
3848 static_assert(std::is_same_v<DataT, int4> || std::is_same_v<DataT, uint4> ||
3849 std::is_same_v<DataT, float4> ||
3850 std::is_same_v<DataT, half4>,
3851 "The data type of an image accessor must be only int4, "
3852 "uint4, float4 or half4 from SYCL namespace");
3858 const DataT, DataT>::type;
3862 template <
typename AllocatorT>
3867 : base_class(detail::convertToArrayOfN<3, 1>(ImageRef.
get_range()),
3877 AccessMode, (
const void *)
typeid(DataT).name(),
sizeof(DataT), CodeLoc);
3896 return Rhs.impl == impl;
3899 return !(Rhs == *
this);
3904 #ifndef __SYCL_DEVICE_ONLY__
3905 return getPropList().template has_property<Property>();
3911 #ifndef __SYCL_DEVICE_ONLY__
3912 return getPropList().template get_property<Property>();
3927 typename = std::enable_if_t<
3932 #ifdef __SYCL_DEVICE_ONLY__
3938 return base_class::read<DataT>(Coords);
3949 typename = std::enable_if_t<
3953 void write(
const CoordT &Coords,
const DataT &Color)
const
3954 #ifdef __SYCL_DEVICE_ONLY__
3960 base_class::write<DataT>(Coords, Color);
3967 : base_class{Impl} {}
3969 template <
class Obj>
3979 #ifndef __SYCL_DEVICE_ONLY__
3983 sampled_image_accessor<DataT, Dimensions, AccessTarget>> {
3984 static_assert(std::is_same_v<DataT, int4> || std::is_same_v<DataT, uint4> ||
3985 std::is_same_v<DataT, float4> ||
3986 std::is_same_v<DataT, half4>,
3987 "The data type of an image accessor must be only int4, "
3988 "uint4, float4 or half4 from SYCL namespace");
3990 #ifdef __SYCL_DEVICE_ONLY__
4001 template <
typename AllocatorT>
4006 #ifdef __SYCL_DEVICE_ONLY__
4009 (void)CommandGroupHandlerRef;
4014 : host_base_class(detail::convertToArrayOfN<3, 1>(ImageRef.
get_range()),
4017 {ImageRef.getRowPitch(), ImageRef.getSlicePitch(), 0},
4022 aspect ImageAspect = aspect::image;
4026 "Device associated with command group handler does not have "
4031 (
const void *)
typeid(DataT).name(),
sizeof(DataT), CodeLoc);
4050 #ifdef __SYCL_DEVICE_ONLY__
4054 return Rhs.impl == impl;
4059 return !(Rhs == *
this);
4064 #ifndef __SYCL_DEVICE_ONLY__
4065 return getPropList().template has_property<Property>();
4071 #ifndef __SYCL_DEVICE_ONLY__
4072 return getPropList().template get_property<Property>();
4079 #ifdef __SYCL_DEVICE_ONLY__
4083 return host_base_class::getSize().size();
4090 template <
typename CoordT,
4094 #ifdef __SYCL_DEVICE_ONLY__
4096 std::ignore = Coords;
4097 return {0, 0, 0, 0};
4099 return host_base_class::read<DataT>(Coords);
4105 #ifndef __SYCL_DEVICE_ONLY__
4106 : host_base_class{Impl}
4112 template <
class Obj>
4119 template <
typename DataT,
int Dimensions>
4123 host_sampled_image_accessor<DataT, Dimensions>> {
4124 static_assert(std::is_same_v<DataT, int4> || std::is_same_v<DataT, uint4> ||
4125 std::is_same_v<DataT, float4> ||
4126 std::is_same_v<DataT, half4>,
4127 "The data type of an image accessor must be only int4, "
4128 "uint4, float4 or half4 from SYCL namespace");
4137 template <
typename AllocatorT>
4142 : base_class(detail::convertToArrayOfN<3, 1>(ImageRef.
get_range()),
4152 (
const void *)
typeid(DataT).name(),
sizeof(DataT), CodeLoc);
4170 return Rhs.impl == impl;
4173 return !(Rhs == *
this);
4178 #ifndef __SYCL_DEVICE_ONLY__
4179 return getPropList().template has_property<Property>();
4185 #ifndef __SYCL_DEVICE_ONLY__
4186 return getPropList().template get_property<Property>();
4197 template <
typename CoordT,
4200 DataT
read(
const CoordT &Coords)
const
4201 #ifdef __SYCL_DEVICE_ONLY__
4207 return base_class::read<DataT>(Coords);
4213 : base_class{Impl} {}
4215 template <
class Obj>
4235 #ifdef __SYCL_DEVICE_ONLY__
4243 return hash<decltype(AccImplPtr)>()(AccImplPtr);
4248 template <
typename DataT,
int Dimensions, sycl::access_mode AccessMode>
4253 #ifdef __SYCL_DEVICE_ONLY__
4260 return hash<decltype(AccImplPtr)>()(AccImplPtr);
4265 template <
typename DataT,
int Dimensions>
4266 struct hash<
sycl::local_accessor<DataT, Dimensions>> {
4270 #ifdef __SYCL_DEVICE_ONLY__
4277 return hash<decltype(AccImplPtr)>()(AccImplPtr);
4284 struct hash<
sycl::unsampled_image_accessor<DataT, Dimensions, AccessMode,
4290 #ifdef __SYCL_DEVICE_ONLY__
4296 return hash<decltype(AccImplPtr)>()(AccImplPtr);
4301 template <
typename DataT,
int Dimensions, sycl::access_mode AccessMode>
4303 sycl::host_unsampled_image_accessor<DataT, Dimensions, AccessMode>> {
4309 return hash<decltype(AccImplPtr)>()(AccImplPtr);
4313 template <
typename DataT,
int Dimensions, sycl::image_target AccessTarget>
4314 struct hash<
sycl::sampled_image_accessor<DataT, Dimensions, AccessTarget>> {
4318 #ifdef __SYCL_DEVICE_ONLY__
4324 return hash<decltype(AccImplPtr)>()(AccImplPtr);
4329 template <
typename DataT,
int Dimensions>
4330 struct hash<
sycl::host_sampled_image_accessor<DataT, Dimensions>> {
4335 return hash<decltype(AccImplPtr)>()(AccImplPtr);
The file contains implementation of accessor iterator class.
local_ptr< DataT > get_pointer() const
accessor(sycl::image< Dimensions, AllocatorT > &Image)
accessor(sycl::image< Dimensions, AllocatorT > &Image, const property_list &propList)
Defines a shared array that can be used by kernels in queues.
range< 3 > & getMemoryRange()
unsigned int getElemSize() const
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
SampledImageAccessorImplPtr impl
DataT read(const CoordT &Coords) const
SampledImageAccessorBaseHost(const SampledImageAccessorImplPtr &Impl)
UnsampledImageAccessorBaseHost(const UnsampledImageAccessorImplPtr &Impl)
void write(const CoordT &Coords, const DataT &Color) const
UnsampledImageAccessorImplPtr impl
DataT read(const CoordT &Coords) const noexcept
__SYCL2020_DEPRECATED("get_count() is deprecated, please use size() instead") size_t get_count() const
range< Dims > get_range() const
DataT read(const CoordT &Coords) const
size_t size() const noexcept
void write(const CoordT &Coords, const DataT &Color) const
DataT read(const CoordT &Coords, const sampler &Smpl) const
__image_array_slice__(accessor< DataT, Dimensions, AccessMode, access::target::image_array, IsPlaceholder, ext::oneapi::accessor_property_list<>> BaseAcc, size_t Idx)
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
size_t size() const noexcept
image_accessor(image< Dims, AllocatorT > &ImageRef, int ImageElementSize)
bool operator!=(const image_accessor &Rhs) const
const DataT & const_reference
__SYCL2020_DEPRECATED("get_count() is deprecated, please use size() instead") size_t get_count() const
void write(const CoordT &Coords, const DataT &Color) const
range< Dims > get_range() const
image_accessor(const AccessorImplPtr &Impl)
bool operator==(const image_accessor &Rhs) const
DataT read(const CoordT &Coords) const
DataT read(const CoordT &Coords, const sampler &Smpl) const
image_accessor(image< Dims, AllocatorT > &ImageRef, handler &CommandGroupHandlerRef, int ImageElementSize)
range< Dimensions > get_range() const
size_t size() const noexcept
size_t getElementSize() const
image_sampler getSampler() const noexcept
size_t getRowPitch() const
image_channel_order getChannelOrder() const
size_t getSlicePitch() const
image_channel_type getChannelType() const
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
bool has(aspect Aspect) const __SYCL_WARN_IMAGE_ASPECT(Aspect)
Indicates if the SYCL device has the given feature.
Command group handler class.
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, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
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 detail::AccessorImplPtr &Impl)
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, Dims, AllocatorT > &BufferRef, handler &CommandGroupHandler, range< Dimensions > AccessRange, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
host_accessor(const host_accessor< DataT_, Dimensions, AccessMode_ > &other)
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, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
const host_accessor & operator=(const typename AccessorT::value_type &Other) const
host_accessor(const host_accessor< DataT_, Dimensions, AccessMode > &other)
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(buffer< T, Dims, AllocatorT > &BufferRef, mode_tag_t< AccessMode >, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
decltype(Obj::impl) friend getSyclObjImpl(const Obj &SyclObject)
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())
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())
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())
const host_accessor & operator=(typename AccessorT::value_type &&Other) const
bool ext_oneapi_owner_before(const ext::oneapi::detail::weak_object_base< host_accessor > &Other) const noexcept
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, 1, AllocatorT > &BufferRef, const property_list &PropertyList={}, const detail::code_location CodeLoc=detail::code_location::current())
bool has_property() const noexcept
bool operator!=(const host_sampled_image_accessor &Rhs) const
host_sampled_image_accessor(const host_sampled_image_accessor &Rhs)=default
DataT read(const CoordT &Coords) const
host_sampled_image_accessor & operator=(const host_sampled_image_accessor &Rhs)=default
host_sampled_image_accessor(host_sampled_image_accessor &&Rhs)=default
bool operator==(const host_sampled_image_accessor &Rhs) const
Property get_property() const
const DataT & const_reference
~host_sampled_image_accessor()=default
host_sampled_image_accessor(sampled_image< Dimensions, AllocatorT > &ImageRef, const property_list &PropList={}, const detail::code_location CodeLoc=detail::code_location::current())
size_t size() const noexcept
host_sampled_image_accessor & operator=(host_sampled_image_accessor &&Rhs)=default
host_unsampled_image_accessor(unsampled_image< Dimensions, AllocatorT > &ImageRef, const property_list &PropList={}, const detail::code_location CodeLoc=detail::code_location::current())
void write(const CoordT &Coords, const DataT &Color) const
host_unsampled_image_accessor(const host_unsampled_image_accessor &Rhs)=default
~host_unsampled_image_accessor()=default
host_unsampled_image_accessor(host_unsampled_image_accessor &&Rhs)=default
DataT read(const CoordT &Coords) const noexcept
Property get_property() const
bool has_property() const noexcept
bool operator==(const host_unsampled_image_accessor &Rhs) const
typename std::conditional< AccessMode==access_mode::read, const DataT, DataT >::type value_type
host_unsampled_image_accessor & operator=(host_unsampled_image_accessor &&Rhs)=default
const DataT & const_reference
host_unsampled_image_accessor & operator=(const host_unsampled_image_accessor &Rhs)=default
size_t size() const noexcept
bool operator!=(const host_unsampled_image_accessor &Rhs) const
A unique identifier of an item in an index space.
Defines a shared image data.
range< Dimensions > get_range() const
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,...
bool has_property() const noexcept
sampled_image_accessor(const sampled_image_accessor &Rhs)=default
Property get_property() const
const DataT & const_reference
bool operator==(const sampled_image_accessor &Rhs) const
sampled_image_accessor(sampled_image_accessor &&Rhs)=default
sampled_image_accessor & operator=(sampled_image_accessor &&Rhs)=default
sampled_image_accessor(sampled_image< Dimensions, AllocatorT > &ImageRef, handler &CommandGroupHandlerRef, const property_list &PropList={}, const detail::code_location CodeLoc=detail::code_location::current())
size_t size() const noexcept
sampled_image_accessor & operator=(const sampled_image_accessor &Rhs)=default
DataT read(const CoordT &Coords) const noexcept
~sampled_image_accessor()=default
bool operator!=(const sampled_image_accessor &Rhs) const
DataT read(const CoordT &Coords) const noexcept
bool operator!=(const unsampled_image_accessor &Rhs) const
void write(const CoordT &Coords, const DataT &Color) const
bool has_property() const noexcept
unsampled_image_accessor & operator=(unsampled_image_accessor &&Rhs)=default
~unsampled_image_accessor()=default
size_t size() const noexcept
bool operator==(const unsampled_image_accessor &Rhs) const
Property get_property() const
const DataT & const_reference
unsampled_image_accessor & operator=(const unsampled_image_accessor &Rhs)=default
typename std::conditional< AccessMode==access_mode::read, const DataT, DataT >::type value_type
unsampled_image_accessor(const unsampled_image_accessor &Rhs)=default
unsampled_image_accessor(unsampled_image_accessor &&Rhs)=default
unsampled_image_accessor(unsampled_image< Dimensions, AllocatorT > &ImageRef, handler &CommandGroupHandlerRef, const property_list &PropList={}, const detail::code_location CodeLoc=detail::code_location::current())
class sycl::vec ///////////////////////// Provides a cross-patform vector class template that works e...
#define __SYCL_SPECIAL_CLASS
class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(local_accessor) local_accessor 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.
void unsampledImageConstructorNotification(void *ImageObj, void *AccessorObj, const std::optional< image_target > &Target, access::mode Mode, const void *Type, uint32_t ElemSize, const code_location &CodeLoc)
void addHostUnsampledImageAccessorAndWait(UnsampledImageAccessorImplHost *Req)
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)
std::shared_ptr< UnsampledImageAccessorImplHost > UnsampledImageAccessorImplPtr
void imageWriteHostImpl(const CoordT &Coords, const WriteDataT &Color, id< 3 > ImgPitch, uint8_t ElementSize, image_channel_type ImgChannelType, image_channel_order ImgChannelOrder, void *BasePtr)
constexpr access::mode accessModeFromConstness()
void addHostSampledImageAccessorAndWait(SampledImageAccessorImplHost *Req)
boost::mp11::mp_set_contains< TypeList, std::remove_cv_t< T > > is_contained
std::shared_ptr< SampledImageAccessorImplHost > SampledImageAccessorImplPtr
decltype(Obj::impl) getSyclObjImpl(const Obj &SyclObject)
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)
boost::mp11::mp_list< T... > type_list
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
void sampledImageConstructorNotification(void *ImageObj, void *AccessorObj, const std::optional< image_target > &Target, const void *Type, uint32_t ElemSize, const code_location &CodeLoc)
constexpr access::mode deduceAccessMode()
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 __SYCL_TYPE(local_accessor) local_accessor 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 __SYCL_TYPE(local_accessor) local_accessor 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 __SYCL_TYPE(local_accessor) local_accessor 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
size_t operator()(const AccType &A) const
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