|
Uni20
Asynchronous tensor and runtime library.
|
Owning contiguous host buffer used by HostStorage.
More...
#include <host_storage.hpp>
Public Types | |
| using | const_iterator = value_type const * |
| using | iterator = value_type * |
| using | size_type = std::size_t |
| using | value_type = ElementType |
Public Member Functions | |
| auto | begin () const noexcept -> const_iterator |
| auto | begin () noexcept -> iterator |
| void | clear () noexcept |
| auto | data () const noexcept -> value_type const * |
| auto | data () noexcept -> value_type * |
| bool | empty () const noexcept |
| auto | end () const noexcept -> const_iterator |
| auto | end () noexcept -> iterator |
| HostBuffer () noexcept=default | |
| HostBuffer (HostBuffer &&other) noexcept | |
| HostBuffer (HostBuffer const &other) | |
| HostBuffer (size_type size) | |
Allocate storage for size elements. | |
| HostBuffer (size_type size, StorageInitialization initialization) | |
| Allocate elements with an explicit numerical initialization policy. | |
| HostBuffer (size_type size, value_type const &value) | |
| Allocate and fill storage with one value. | |
| auto | operator= (HostBuffer &&other) noexcept -> HostBuffer & |
| auto | operator= (HostBuffer const &other) -> HostBuffer & |
| auto | operator[] (size_type index) const noexcept -> value_type const & |
| auto | operator[] (size_type index) noexcept -> value_type & |
| void | resize (size_type size) |
| Replace the allocation while preserving the common prefix. | |
| void | resize (size_type size, StorageInitialization initialization) |
| Preserve the common prefix and initialize only newly added elements. | |
| auto | size () const noexcept -> size_type |
| void | swap (HostBuffer &other) noexcept |
| ~HostBuffer () | |
Static Public Attributes | |
| static constexpr bool | initializes_elements = !uninitialized_ok<value_type> |
Owning contiguous host buffer used by HostStorage.
Allocation and growth leave uninitialized_ok elements unspecified. Other element types are value-constructed and destroyed normally. Copying preserves every stored object representation, and resizing preserves the common prefix just like std::vector::resize.
| ElementType | Element type held in pageable host memory. |
| using uni20::HostBuffer< ElementType >::const_iterator = value_type const* |
| using uni20::HostBuffer< ElementType >::iterator = value_type* |
| using uni20::HostBuffer< ElementType >::size_type = std::size_t |
| using uni20::HostBuffer< ElementType >::value_type = ElementType |
|
defaultnoexcept |
|
inlineexplicit |
Allocate storage for size elements.
Values are unspecified when value_type satisfies uninitialized_ok; otherwise elements are value-constructed.
|
inline |
Allocate elements with an explicit numerical initialization policy.
| std::invalid_argument | If Zero is requested for a type without a zero/default value. |
|
inline |
Allocate and fill storage with one value.
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Replace the allocation while preserving the common prefix.
Newly added uninitialized_ok elements have unspecified values.
|
inline |
Preserve the common prefix and initialize only newly added elements.
|
inlinenoexcept |
|
inlinenoexcept |
|
staticconstexpr |