|
| | SharedBuffer (SharedBuffer &&)=default |
| | SharedBuffer (SharedBuffer const &)=default |
| template<typename T_Type_Other> |
| | SharedBuffer (SharedBuffer< T_Api, T_Type_Other, T_Extents, T_MemAlignment > &&other) |
| template<typename T_Type_Other> |
| | SharedBuffer (SharedBuffer< T_Api, T_Type_Other, T_Extents, T_MemAlignment > const &other) |
| template<alpaka::concepts::HasApi T_Any, alpaka::concepts::Vector T_UserExtents, alpaka::concepts::Vector T_UserPitches> |
| | SharedBuffer (T_Any const &any, T_Type *data, T_UserExtents const &extents, T_UserPitches const &pitches, std::invocable<> auto deleter, T_MemAlignment const memAlignment=Alignment{}) |
| void | addDestructorAction (std::function< void()> &&action) |
| | Adds a destructor action to the shared buffer.
|
| void | destructorWaitFor (auto const &any) |
| | Add an action to be executed when the shared_ptr is destroyed.
|
| auto | getConstSharedBuffer () const |
| | create a read shared buffer view
|
| auto | getSubSharedBuffer (alpaka::concepts::VectorOrScalar auto const &extents) |
| auto | getSubSharedBuffer (alpaka::concepts::VectorOrScalar auto const &extents) const |
| | Creates a buffer pointing to a part of the memory.
|
| auto | getSubSharedBuffer (alpaka::concepts::VectorOrScalar auto const &offsets, alpaka::concepts::VectorOrScalar auto const &extents) |
| auto | getSubSharedBuffer (alpaka::concepts::VectorOrScalar auto const &offsets, alpaka::concepts::VectorOrScalar auto const &extents) const |
| | Creates a shared sub-buffer view to a part of the memory.
|
| constexpr long | getUseCount () const noexcept |
| | Return the number of SharedBuffers which points to the same memory.
|
| auto | getView () |
| auto | getView () const |
| void | keepAlive (auto &queue) |
| | Keep the buffer alive until at least the current spot in the queue, even if it runs out of scope.
|
| constexpr | operator bool () const noexcept |
| | True if SharedBuffer is pointing to valid memory.
|
| SharedBuffer & | operator= (SharedBuffer &&)=default |
| SharedBuffer & | operator= (SharedBuffer const &otherSharedBuffer)=default |
| | Assignment operator keeping const-ness.
|
| constexpr | View (T_Any const &any, T_Type *data, T_UserExtents const &extents, T_UserPitches const &pitches, T_MemAlignment const memAlignment=T_MemAlignment{}) |
| | Creates a view.
|
| constexpr auto | getConstView () const |
| | create a read only view
|
| constexpr alpaka::concepts::IMdSpan auto | getMdSpan () const |
| constexpr View & | operator= (View const &)=default |
| | Assignment operator keeping const-ness.
|
| constexpr auto | getSubView (alpaka::concepts::VectorOrScalar auto const &extents) const |
| | Creates a sub view to a part of the memory.
|
| constexpr | MdSpan ()=default |
| constexpr auto | begin () const |
| constexpr auto | cbegin () const |
| constexpr auto | cend () const |
| constexpr const_pointer | data () const |
| | get origin pointer
|
| constexpr auto | end () const |
| constexpr auto | getConstMdSpan () const |
| constexpr auto | getExtents () const |
| constexpr T_Pitches | getPitches () const |
| constexpr | operator bool () const noexcept |
| | True if MdSpan is pointing to valid memory.
|
| constexpr const_reference | operator* () const |
| | return value the origin pointer is pointing to
|
| constexpr MdSpan & | operator= (MdSpan const &)=default |
| | Assignment operator keeping const-ness.
|
| constexpr const_reference | operator[] (concepts::IndexVec< index_type, alpaka::trait::GetDim< T_Extents >::value > auto const &idx) const |
| | get value at the given index
|
Life time managed buffer with contiguous data.
This buffer owns the data and will deallocate it when last copy is destroyed. Const-ness of the buffer instance is propagated to the data region. A copy of this instance will only perform a shallow copy, to perform a deep copy to duplicate the data you should use onHost::memcpy.
Definition at line 39 of file SharedBuffer.hpp.
Keep the buffer alive until at least the current spot in the queue, even if it runs out of scope.
This ensures that the buffer is and stays valid in previously enqueued kernels. There is no guarantee that the buffer is deleted immediately when the last reference to it is deleted.
This differs from destructorWaitFor, because that function waits, while keepAlive does not block anything, it just extends lifetime.
- Attention
- Do not apply this function to a buffer allocated with alpaka::onHost::allocDeferred, see https://github.com/alpaka-group/alpaka3/issues/394
- Parameters
-
| queue | The queue to enqueue to. |
Definition at line 252 of file SharedBuffer.hpp.