|
Uni20
Asynchronous tensor and runtime library.
|
Move-only RAII lease exposing a read-only ImmediateTensorView. More...
#include <access.hpp>
Public Types | |
| using | access_state_type = AccessState |
| using | backend_selector_type = BackendSelector |
| using | extents_type = typename mdspan_type::extents_type |
| using | index_type = typename mdspan_type::index_type |
| using | mdspan_type = Mdspan |
| using | storage_policy = StoragePolicy |
Public Member Functions | |
| backend_selector_type const & | backend_selector () const noexcept |
| Return the backend selector retained from the source tensor view. | |
| index_type | extent (std::size_t axis) const |
| Return one resolved tensor extent. | |
| extents_type const & | extents () const |
| Return the resolved tensor extents. | |
| mdspan_type & | mdspan () & |
| Return the resolved read-only mdspan. | |
| mdspan_type | mdspan () &&=delete |
| mdspan_type const & | mdspan () const & |
| Return the resolved read-only mdspan. | |
| read_tensor_lease & | operator= (read_tensor_lease &&other) noexcept |
| read_tensor_lease & | operator= (read_tensor_lease const &)=delete |
| read_tensor_lease (access_state_type state, mdspan_type mdspan, backend_selector_type selector) noexcept | |
| Construct an active read lease. | |
| read_tensor_lease (read_tensor_lease &&other) noexcept | |
| read_tensor_lease (read_tensor_lease const &)=delete | |
| void | release () noexcept |
| End the access scope and make this lease inactive. | |
| decltype(auto) | storage () const |
| Return the storage retained by access state when it exposes one. | |
| ~read_tensor_lease () | |
Static Public Member Functions | |
| static constexpr std::size_t | rank () noexcept |
| Return the static tensor rank. | |
Move-only RAII lease exposing a read-only ImmediateTensorView.
The access state is stored before the mdspan so the mdspan is destroyed before the state that makes its data handle usable. Independent lease types may model ReadTensorLease without using this class template.
| Mdspan | Read-only resolved mdspan type. |
| AccessState | RAII state retaining the acquired data handle. |
| BackendSelector | Backend list copied from the source tensor view. |
| StoragePolicy | Storage policy associated with the source tensor view. |
| using uni20::read_tensor_lease< Mdspan, AccessState, BackendSelector, StoragePolicy >::access_state_type = AccessState |
| using uni20::read_tensor_lease< Mdspan, AccessState, BackendSelector, StoragePolicy >::backend_selector_type = BackendSelector |
| using uni20::read_tensor_lease< Mdspan, AccessState, BackendSelector, StoragePolicy >::extents_type = typename mdspan_type::extents_type |
| using uni20::read_tensor_lease< Mdspan, AccessState, BackendSelector, StoragePolicy >::index_type = typename mdspan_type::index_type |
| using uni20::read_tensor_lease< Mdspan, AccessState, BackendSelector, StoragePolicy >::mdspan_type = Mdspan |
| using uni20::read_tensor_lease< Mdspan, AccessState, BackendSelector, StoragePolicy >::storage_policy = StoragePolicy |
|
inlinenoexcept |
Construct an active read lease.
|
delete |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
Return the backend selector retained from the source tensor view.
|
inline |
Return one resolved tensor extent.
|
inline |
Return the resolved tensor extents.
|
inline |
Return the resolved read-only mdspan.
|
delete |
|
inline |
Return the resolved read-only mdspan.
|
inlinenoexcept |
|
delete |
|
inlinestaticconstexprnoexcept |
Return the static tensor rank.
|
inlinenoexcept |
End the access scope and make this lease inactive.
Invalidates the resolved mdspan before releasing the access state. Repeated calls have no effect.
|
inline |
Return the storage retained by access state when it exposes one.