|
Uni20
Asynchronous tensor and runtime library.
|
One CUDA allocation partitioned into independent logical buffers. More...
#include <buffer.hpp>
Public Types | |
| using | buffer_type = CudaBuffer< T > |
| using | element_type = T |
Public Member Functions | |
| CudaBuffer< T > & | buffer (std::size_t ordinal) |
| Return one mutable logical child buffer. | |
| CudaBuffer< T > const & | buffer (std::size_t ordinal) const |
| Return one read-only logical child buffer. | |
| std::size_t | buffer_count () const noexcept |
| Return the number of logical child buffers. | |
| Device | device () const |
| Return the CUDA device containing the physical allocation. | |
| PartitionedCudaBuffer & | operator= (PartitionedCudaBuffer &&other) noexcept |
| PartitionedCudaBuffer & | operator= (PartitionedCudaBuffer const &)=delete |
| PartitionedCudaBuffer (DeviceResources &resources, std::size_t size, std::span< CudaBufferRange const > ranges) | |
| PartitionedCudaBuffer (PartitionedCudaBuffer &&other) noexcept | |
| PartitionedCudaBuffer (PartitionedCudaBuffer const &)=delete | |
| auto | read_synchronized_with (Stream const &stream) const -> PartitionedReadAccess< T > |
| Acquire read access to the complete contiguous allocation. | |
| DeviceResources & | resources () const |
| Return the device resources shared by every child buffer. | |
| std::size_t | size () const noexcept |
| Return the total physical allocation size in elements. | |
| auto | write_synchronized_with (Stream const &stream) -> PartitionedWriteAccess< T > |
| Acquire write access to the complete contiguous allocation. | |
Friends | |
| template<typename > | |
| class | PartitionedReadAccess |
| template<typename > | |
| class | PartitionedWriteAccess |
One CUDA allocation partitioned into independent logical buffers.
Construction validates the disjoint ranges once. Each child owns an independent completion ledger while sharing the physical allocation and device resources with its siblings.
| using uni20::cuda::PartitionedCudaBuffer< T >::buffer_type = CudaBuffer<T> |
| using uni20::cuda::PartitionedCudaBuffer< T >::element_type = T |
|
inline |
|
delete |
|
inlinenoexcept |
|
inline |
Return one mutable logical child buffer.
|
inline |
Return one read-only logical child buffer.
|
inlinenoexcept |
Return the number of logical child buffers.
|
inline |
Return the CUDA device containing the physical allocation.
|
inlinenoexcept |
|
delete |
| auto uni20::cuda::PartitionedCudaBuffer< T >::read_synchronized_with | ( | Stream const & | stream | ) | const -> PartitionedReadAccess<T> |
Acquire read access to the complete contiguous allocation.
The access waits on every child ledger and publishes one shared completion to all children on release.
|
inline |
Return the device resources shared by every child buffer.
|
inlinenoexcept |
Return the total physical allocation size in elements.
| auto uni20::cuda::PartitionedCudaBuffer< T >::write_synchronized_with | ( | Stream const & | stream | ) | -> PartitionedWriteAccess<T> |
Acquire write access to the complete contiguous allocation.
The access waits on every child ledger and publishes one shared completion to all children on release.