27 inline namespace _V1 {
28 namespace ext::oneapi {
35 static_assert(Dims >= 0 && Dims < 4,
"Invalid dimensionality in range.");
36 if constexpr (Dims == 0)
38 if constexpr (Dims == 1)
40 else if constexpr (Dims == 2)
52 template <
typename SYCLObjT>
72 #ifndef __SYCL_DEVICE_ONLY__
77 return sycl::detail::createSyclObjFromImpl<SYCLObjT>(MObjImplPtr);
80 std::optional<SYCLObjT> OptionalObj =
try_lock();
83 "Referenced object has expired.");
90 SYCLObjT
lock() const;
96 template <
typename T,
int Dimensions,
typename AllocatorT>
108 MRange{detail::createDummyRange<Dimensions>()}, MOffsetInBytes{0},
109 MIsSubBuffer{
false} {}
112 MOffsetInBytes{SYCLObj.OffsetInBytes},
113 MIsSubBuffer{SYCLObj.IsSubBuffer} {}
121 this->MRange = SYCLObj.Range;
122 this->MOffsetInBytes = SYCLObj.OffsetInBytes;
123 this->MIsSubBuffer = SYCLObj.IsSubBuffer;
131 std::swap(MRange, Other.MRange);
132 std::swap(MOffsetInBytes, Other.MOffsetInBytes);
133 std::swap(MIsSubBuffer, Other.MIsSubBuffer);
136 #ifndef __SYCL_DEVICE_ONLY__
142 return buffer_type{MObjImplPtr, MRange, MOffsetInBytes, MIsSubBuffer};
145 std::optional<buffer_type> OptionalObj =
try_lock();
148 "Referenced object has expired.");
155 buffer_type
lock() const;
161 size_t MOffsetInBytes;
175 MWeakGlobalBuf{SYCLObj.GlobalBuf},
176 MWeakGlobalOffset{SYCLObj.GlobalOffset},
177 MWeakGlobalFlushBuf{SYCLObj.GlobalFlushBuf} {}
184 MWeakGlobalBuf = SYCLObj.GlobalBuf;
185 MWeakGlobalOffset = SYCLObj.GlobalOffset;
186 MWeakGlobalFlushBuf = SYCLObj.GlobalFlushBuf;
194 MWeakGlobalBuf.swap(Other.MWeakGlobalBuf);
195 MWeakGlobalOffset.swap(Other.MWeakGlobalOffset);
196 MWeakGlobalFlushBuf.swap(Other.MWeakGlobalFlushBuf);
201 MWeakGlobalBuf.reset();
202 MWeakGlobalOffset.reset();
203 MWeakGlobalFlushBuf.reset();
206 #ifndef __SYCL_DEVICE_ONLY__
209 auto GlobalBuf = MWeakGlobalBuf.try_lock();
210 auto GlobalOffset = MWeakGlobalOffset.try_lock();
211 auto GlobalFlushBuf = MWeakGlobalFlushBuf.try_lock();
212 if (!ObjImplPtr || !GlobalBuf || !GlobalOffset || !GlobalFlushBuf)
214 return stream{ObjImplPtr, *GlobalBuf, *GlobalOffset, *GlobalFlushBuf};
217 std::optional<stream> OptionalObj =
try_lock();
220 "Referenced object has expired.");
The file contains implementations of accessor class.
Defines a shared array that can be used by kernels in queues.
decltype(sycl::detail::getSyclObjImpl(std::declval< SYCLObjT >())) ::weak_type MObjWeakPtr
constexpr weak_object_base() noexcept
static decltype(MObjWeakPtr) GetWeakImpl(const SYCLObjT &SYCLObj)
constexpr weak_object() noexcept
weak_object & operator=(const buffer_type &SYCLObj) noexcept
weak_object & operator=(weak_object &&Other) noexcept=default
weak_object(const buffer_type &SYCLObj) noexcept
std::optional< buffer_type > try_lock() const noexcept
weak_object & operator=(const weak_object &Other) noexcept=default
void swap(weak_object &Other) noexcept
weak_object(const weak_object &Other) noexcept=default
weak_object(weak_object &&Other) noexcept=default
typename detail::weak_object_base< buffer_type >::object_type object_type
weak_object(const weak_object &Other) noexcept=default
weak_object & operator=(const stream &SYCLObj) noexcept
weak_object(const stream &SYCLObj) noexcept
weak_object & operator=(const weak_object &Other) noexcept=default
constexpr weak_object() noexcept
weak_object & operator=(weak_object &&Other) noexcept=default
void swap(weak_object &Other) noexcept
std::optional< stream > try_lock() const noexcept
weak_object(weak_object &&Other) noexcept=default
typename detail::weak_object_base< stream >::object_type object_type
typename detail::weak_object_base< SYCLObjT >::object_type object_type
weak_object(weak_object &&Other) noexcept=default
weak_object(const weak_object &Other) noexcept=default
weak_object & operator=(const weak_object &Other) noexcept=default
weak_object & operator=(const SYCLObjT &SYCLObj) noexcept
weak_object & operator=(weak_object &&Other) noexcept=default
std::optional< SYCLObjT > try_lock() const noexcept
constexpr weak_object() noexcept=default
static range< Dims > createDummyRange()
class __SYCL_EBO __SYCL_SPECIAL_CLASS Dimensions
std::error_code make_error_code(sycl::errc E) noexcept
Constructs an error code using e and sycl_category()
_Abi const simd< _Tp, _Abi > & noexcept