|
Uni20
Asynchronous tensor and runtime library.
|
General-purpose owning tensor with immediate or deferred mdspan metadata. More...
#include <basic_tensor.hpp>
Public Types | |
| using | accessor_factory_type = AccessorFactory |
| using | accessor_type = typename accessor_factory_type::template accessor_t< element_type > |
| using | backend_selector_type = typename storage_policy::backend_selector_type |
| using | const_accessor_type = typename accessor_factory_type::template accessor_t< element_type const > |
| using | const_device_accessor_type = detail::tensor_device_accessor_t< accessor_factory_type, element_type const > |
| using | const_mdspan_type = stdex::mdspan< element_type const, extents_type, layout_policy, const_accessor_type > |
| using | device_accessor_type = detail::tensor_device_accessor_t< accessor_factory_type, element_type > |
| using | element_type = ElementType |
| using | extents_type = Extents |
| using | handle_type = typename const_accessor_type::data_handle_type |
| using | index_type = typename extents_type::index_type |
| using | layout_policy = LayoutPolicy |
| using | layout_type = layout_policy |
| using | mapping_type = typename layout_policy::template mapping< extents_type > |
| using | mdspan_type = stdex::mdspan< element_type, extents_type, layout_policy, accessor_type > |
| using | mutable_handle_type = typename accessor_type::data_handle_type |
| template<typename NewExtents > | |
| using | rebind_extents_type = Tensor< element_type, NewExtents::rank(), storage_policy, layout_policy, accessor_factory_type, NewExtents > |
| Rebind this owning tensor configuration to another extents type. | |
| template<typename NewLayoutPolicy > | |
| using | rebind_layout_type = Tensor< element_type, Rank, storage_policy, NewLayoutPolicy, accessor_factory_type, extents_type > |
| Rebind this owning tensor configuration to another layout policy. | |
| using | size_type = uni20::size_type |
| using | storage_policy = StoragePolicy |
| using | storage_type = typename storage_policy::template storage_t< element_type > |
| using | value_type = std::remove_cv_t< element_type > |
Public Member Functions | |
| auto | accessor () const noexcept -> const_accessor_type |
| Construct the tensor's read-only accessor. | |
| auto | accessor () noexcept -> accessor_type |
| Construct the tensor's mutable accessor. | |
| auto | cols () const noexcept |
| Return the matrix column count for rank-two tensors. | |
| auto | data () const noexcept -> element_type const *requires(immediately_readable &&(std::same_as< layout_type, stdex::layout_left >||std::same_as< layout_type, stdex::layout_right >) &&is_default_accessor_v< const_accessor_type > &&std::same_as< handle_type, element_type const * >) |
| Return contiguous read-only element storage for a canonical tensor. | |
| auto | data () noexcept -> element_type *requires(immediately_writable &&(std::same_as< layout_type, stdex::layout_left >||std::same_as< layout_type, stdex::layout_right >) &&is_default_accessor_v< accessor_type > &&std::same_as< mutable_handle_type, element_type * >) |
| Return contiguous mutable element storage for a canonical tensor. | |
| auto | device_accessor () const noexcept -> const_device_accessor_type |
| Construct the accessor stored in a read-only mdspec. | |
| auto | device_accessor () noexcept -> device_accessor_type |
| Construct the accessor stored in a mutable mdspec. | |
| auto | extent (size_type axis) const noexcept |
| Return one tensor extent. | |
| auto | extents () const noexcept -> extents_type const & |
| Return the tensor extents. | |
| auto | handle () const noexcept -> handle_type |
| Return the tensor's const storage handle. | |
| auto | mapping () const noexcept -> mapping_type const & |
| Return the tensor mapping. | |
| auto | mdspan () const noexcept -> const_mdspan_type |
| Resolve a read-only mdspan over the owned storage. | |
| auto | mdspan () noexcept -> mdspan_type |
| Resolve a writable mdspan over the owned storage. | |
| auto | mdspec () const noexcept |
| Return read-only mdspan metadata for explicit data-handle acquisition. | |
| auto | mdspec () noexcept |
| Return mutable mdspan metadata for explicit data-handle acquisition. | |
| auto | mutable_handle () noexcept -> mutable_handle_type |
| Return the tensor's mutable storage handle. | |
| Tensor & | operator= (Tensor &&other)=default |
| Move-assign tensor storage and descriptor state. | |
| Tensor & | operator= (Tensor const &other)=default |
| Copy-assign tensor storage and descriptor state. | |
| template<class... Index> requires (sizeof...(Index) == extents_type::rank() && immediately_readable) | |
| decltype(auto) | operator[] (Index... indices) const noexcept |
| Access a const tensor element. | |
| template<class... Index> requires (sizeof...(Index) == extents_type::rank() && immediately_writable) | |
| decltype(auto) | operator[] (Index... indices) noexcept |
| Access a mutable tensor element. | |
| decltype(auto) | operator[] (std::array< index_type, extents_type::rank()> const &indices) const noexcept |
| Access a const tensor element through an index array. | |
| decltype(auto) | operator[] (std::array< index_type, extents_type::rank()> const &indices) noexcept |
| Access a mutable tensor element through an index array. | |
| accessor_factory_type | release_accessor_factory () &&noexcept(std::is_nothrow_move_constructible_v< accessor_factory_type >) |
| Transfer the accessor-factory state out of this tensor. | |
| storage_type | release_storage () &&noexcept(std::is_nothrow_move_constructible_v< storage_type >) |
| Transfer the underlying storage container out of this tensor. | |
| template<class Placement > requires (std::copy_constructible<accessor_factory_type> && std::is_nothrow_swappable_v<mapping_type> && std::is_nothrow_swappable_v<storage_type> && std::is_nothrow_swappable_v<accessor_factory_type> && requires(Placement const& required_placement, std::size_t count) { { storage_policy::template make_storage<element_type>(required_placement, count, StorageInitialization::Uninitialized) } -> std::same_as<storage_type>; }) | |
| void | replace (extents_type const &exts, Placement const &placement) |
| Replace tensor shape and storage to satisfy a placement requirement. | |
| template<class Placement > requires (std::copy_constructible<accessor_factory_type> && std::is_nothrow_swappable_v<mapping_type> && std::is_nothrow_swappable_v<storage_type> && std::is_nothrow_swappable_v<accessor_factory_type> && requires(Placement const& required_placement, std::size_t count) { { storage_policy::template make_storage<element_type>(required_placement, count, StorageInitialization::Uninitialized) } -> std::same_as<storage_type>; }) | |
| void | replace (uninitialized_t, extents_type const &exts, Placement const &placement) |
| Replace shape and placement with explicitly uninitialized storage. | |
| void | replace_mapping (mapping_type mapping) |
| Replace the tensor mapping without moving or reallocating storage. | |
| void | reset_shape (extents_type const &exts) |
| Replace the tensor shape and initialize its new elements to zero. | |
| void | reset_shape (uninitialized_t, extents_type const &exts) |
| Replace the shape with explicitly uninitialized storage. | |
| auto | rows () const noexcept |
| Return the matrix row count for rank-two tensors. | |
| auto | size () const noexcept -> size_type |
| Return the number of elements in the mapped storage span. | |
| storage_type const & | storage () const noexcept |
| Access the owned storage container. | |
| storage_type & | storage () noexcept |
| Access the owned storage container. | |
| template<class Placement > requires requires(storage_type const& storage, Placement const& placement) { { storage_policy::storage_is_compatible(storage, placement) } -> std::convertible_to<bool>; } | |
| bool | storage_is_compatible (Placement const &placement) const |
| Report whether owned storage satisfies a placement requirement. | |
| Tensor () | |
| Default-construct a rank-zero tensor with its one logical element set to zero. | |
| Tensor ()=default | |
| Default-construct an empty positive-rank tensor without allocated storage. | |
| template<class... Args> requires (std::same_as<storage_policy, HostStorage> && requires(Precision p) { require_precision<value_type>(p); } && extents_type::rank_dynamic() == Rank && sizeof...(Args) == Rank + 1 && std::same_as<std::tuple_element_t<Rank, std::tuple<Args...>>, Precision> && detail::integral_prefix<std::tuple<Args...>>(std::make_index_sequence<Rank>{})) | |
| Tensor (Args... args) | |
| Construct a dynamically shaped tensor with a trailing Precision argument. | |
| template<std::integral... DynamicExtents> requires (extents_type::rank() > 0 && extents_type::rank_dynamic() == extents_type::rank() && sizeof...(DynamicExtents) == extents_type::rank() && detail::DefaultTensorStorage<storage_type>) | |
| Tensor (DynamicExtents... dynamic_extents) | |
| Construct a fully dynamic tensor from one extent per axis. | |
| Tensor (extents_type const &exts, accessor_factory_type accessor_factory=accessor_factory_type{}) | |
| Construct a zero-initialized tensor with default layout and accessor factory. | |
| template<typename MappingBuilder > requires (layout::mapping_builder_for<MappingBuilder, layout_policy, extents_type> && (!std::same_as<std::remove_cvref_t<MappingBuilder>, accessor_factory_type>) && detail::DefaultTensorStorage<storage_type>) | |
| Tensor (extents_type const &exts, MappingBuilder &&mapping_builder, accessor_factory_type accessor_factory=accessor_factory_type{}) | |
| Construct a tensor using a custom mapping builder. | |
| Tensor (extents_type const &exts, Precision p) | |
| Construct actual zeros at the supplied default working precision. | |
| Tensor (extents_type const &exts, std::array< index_type, extents_type::rank()> const &strides, accessor_factory_type accessor_factory=accessor_factory_type{}) | |
| Construct a tensor from explicit extents and strides. | |
| template<TensorView InputTensor> requires (tensor_mdspec_t<InputTensor>::rank() == extents_type::rank() && std::default_initializable<accessor_factory_type> && detail::DefaultTensorStorage<storage_type>) | |
| Tensor (InputTensor const &input) | |
| Materialize an independent owning tensor from a readable tensor view. | |
| template<class Placement > requires requires(Placement const& placement, std::size_t count) { { storage_policy::template make_storage<element_type>(placement, count, StorageInitialization::Uninitialized) } -> std::same_as<storage_type>; } | |
| Tensor (Placement const &placement, extents_type const &exts, accessor_factory_type accessor_factory=accessor_factory_type{}) | |
| Construct a tensor with storage satisfying a placement value. | |
| Tensor (Tensor &&other)=default | |
| Move-construct an owning tensor. | |
| Tensor (Tensor const &other)=default | |
| Copy-construct a tensor with independent owned storage. | |
| template<class Policy = storage_policy, std::integral... DynamicExtents> requires (extents_type::rank() > 0 && extents_type::rank_dynamic() == extents_type::rank() && sizeof...(DynamicExtents) == extents_type::rank() && requires(typename Policy::context_type& context, std::size_t count) { { Policy::template make_storage<element_type>(context, count, StorageInitialization::Uninitialized) } -> std::same_as<storage_type>; }) | |
| Tensor (typename Policy::context_type &context, DynamicExtents... dynamic_extents) | |
| Construct a fully dynamic tensor in an explicit storage context. | |
| template<class Policy = storage_policy> requires requires(typename Policy::context_type& context, std::size_t count) { { Policy::template make_storage<element_type>(context, count, StorageInitialization::Uninitialized) } -> std::same_as<storage_type>; } | |
| Tensor (typename Policy::context_type &context, extents_type const &exts, accessor_factory_type accessor_factory=accessor_factory_type{}) | |
| Construct a tensor in an explicit storage context. | |
| Tensor (uninitialized_t) | |
| Allocate the single rank-zero element without numerical initialization. | |
| template<class... Args> requires (std::same_as<storage_policy, HostStorage> && requires(Precision p) { require_precision<value_type>(p); } && extents_type::rank_dynamic() == Rank && sizeof...(Args) == Rank + 1 && std::same_as<std::tuple_element_t<Rank, std::tuple<Args...>>, Precision> && detail::integral_prefix<std::tuple<Args...>>(std::make_index_sequence<Rank>{})) | |
| Tensor (uninitialized_t, Args... args) | |
| template<std::integral... DynamicExtents> requires (extents_type::rank() > 0 && extents_type::rank_dynamic() == extents_type::rank() && sizeof...(DynamicExtents) == extents_type::rank() && detail::DefaultTensorStorage<storage_type>) | |
| Tensor (uninitialized_t, DynamicExtents... dynamic_extents) | |
| Allocate the requested tensor shape without numerical initialization. | |
| Tensor (uninitialized_t, extents_type const &exts, accessor_factory_type accessor_factory=accessor_factory_type{}) | |
| Allocate the requested tensor shape without numerical initialization. | |
| template<typename MappingBuilder > requires (layout::mapping_builder_for<MappingBuilder, layout_policy, extents_type> && (!std::same_as<std::remove_cvref_t<MappingBuilder>, accessor_factory_type>) && detail::DefaultTensorStorage<storage_type>) | |
| Tensor (uninitialized_t, extents_type const &exts, MappingBuilder &&mapping_builder, accessor_factory_type accessor_factory=accessor_factory_type{}) | |
| Allocate the requested tensor shape without numerical initialization. | |
| Tensor (uninitialized_t, extents_type const &exts, Precision p) | |
| Allocate uninitialized elements with a compatible working precision. | |
| Tensor (uninitialized_t, extents_type const &exts, std::array< index_type, extents_type::rank()> const &strides, accessor_factory_type accessor_factory=accessor_factory_type{}) | |
| Allocate the requested tensor shape without numerical initialization. | |
| template<class Placement > requires requires(Placement const& placement, std::size_t count) { { storage_policy::template make_storage<element_type>(placement, count, StorageInitialization::Uninitialized) } -> std::same_as<storage_type>; } | |
| Tensor (uninitialized_t, Placement const &placement, extents_type const &exts, accessor_factory_type accessor_factory=accessor_factory_type{}) | |
| Allocate the requested tensor shape without numerical initialization. | |
| template<class Policy = storage_policy, std::integral... DynamicExtents> requires (extents_type::rank() > 0 && extents_type::rank_dynamic() == extents_type::rank() && sizeof...(DynamicExtents) == extents_type::rank() && requires(typename Policy::context_type& context, std::size_t count) { { Policy::template make_storage<element_type>(context, count, StorageInitialization::Uninitialized) } -> std::same_as<storage_type>; }) | |
| Tensor (uninitialized_t, typename Policy::context_type &context, DynamicExtents... dynamic_extents) | |
| Allocate the requested tensor shape without numerical initialization. | |
| template<class Policy = storage_policy> requires requires(typename Policy::context_type& context, std::size_t count) { { Policy::template make_storage<element_type>(context, count, StorageInitialization::Uninitialized) } -> std::same_as<storage_type>; } | |
| Tensor (uninitialized_t, typename Policy::context_type &context, extents_type const &exts, accessor_factory_type accessor_factory=accessor_factory_type{}) | |
| Allocate the requested tensor shape without numerical initialization. | |
Static Public Member Functions | |
| static Tensor | adopt_storage (mapping_type mapping, storage_type storage, accessor_factory_type accessor_factory=accessor_factory_type{}) |
| Adopt an existing storage container without reallocating it. | |
| static constexpr auto | backend_selector () noexcept -> backend_selector_type |
| Return the default backend selector associated with this tensor's storage. | |
| static constexpr size_type | rank () noexcept |
| Return the tensor rank. | |
| static constexpr size_type | rank_dynamic () noexcept |
| Return the number of dynamic extents. | |
Static Public Attributes | |
| static constexpr bool | deferred_readable |
| Whether const storage provides deferred read metadata. | |
| static constexpr bool | deferred_writable |
| Whether mutable storage provides deferred write metadata. | |
| static constexpr bool | immediately_readable |
| Whether const storage provides a readable data handle without acquisition. | |
| static constexpr bool | immediately_writable |
| Whether mutable storage provides a writable data handle without acquisition. | |
General-purpose owning tensor with immediate or deferred mdspan metadata.
| ElementType | Value type stored by the tensor. |
| Rank | Static rank of the tensor. |
| StoragePolicy | Policy controlling ownership and allocation of the buffer. |
| LayoutPolicy | Layout policy that determines index ordering and stride computation. |
| AccessorFactory | Factory that produces accessors for the storage handle. |
| Extents | Extents type describing the tensor shape; fully dynamic by default. |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::accessor_factory_type = AccessorFactory |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::accessor_type = typename accessor_factory_type::template accessor_t<element_type> |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::backend_selector_type = typename storage_policy::backend_selector_type |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::const_accessor_type = typename accessor_factory_type::template accessor_t<element_type const> |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::const_device_accessor_type = detail::tensor_device_accessor_t<accessor_factory_type, element_type const> |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::const_mdspan_type = stdex::mdspan<element_type const, extents_type, layout_policy, const_accessor_type> |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::device_accessor_type = detail::tensor_device_accessor_t<accessor_factory_type, element_type> |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::element_type = ElementType |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::extents_type = Extents |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::handle_type = typename const_accessor_type::data_handle_type |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::index_type = typename extents_type::index_type |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::layout_policy = LayoutPolicy |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::layout_type = layout_policy |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::mapping_type = typename layout_policy::template mapping<extents_type> |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::mdspan_type = stdex::mdspan<element_type, extents_type, layout_policy, accessor_type> |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::mutable_handle_type = typename accessor_type::data_handle_type |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::rebind_extents_type = Tensor<element_type, NewExtents::rank(), storage_policy, layout_policy, accessor_factory_type, NewExtents> |
Rebind this owning tensor configuration to another extents type.
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::rebind_layout_type = Tensor<element_type, Rank, storage_policy, NewLayoutPolicy, accessor_factory_type, extents_type> |
Rebind this owning tensor configuration to another layout policy.
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::size_type = uni20::size_type |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::storage_policy = StoragePolicy |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::storage_type = typename storage_policy::template storage_t<element_type> |
| using uni20::Tensor< ElementType, Rank, StoragePolicy, LayoutPolicy, AccessorFactory, Extents >::value_type = std::remove_cv_t<element_type> |
|
default |
Default-construct an empty positive-rank tensor without allocated storage.
|
inline |
Default-construct a rank-zero tensor with its one logical element set to zero.
|
inlineexplicit |
Allocate the single rank-zero element without numerical initialization.
|
default |
Copy-construct a tensor with independent owned storage.
Tensor elements, mapping, and accessor-factory state are copied. Resolved mdspans are constructed on demand from this tensor's own storage.
| other | Source tensor to copy. |
|
default |
Move-construct an owning tensor.
Existing non-owning views and mdspans into the source must not be used after ownership is transferred.
| other | Source tensor to move from. |
|
inlineexplicit |
Materialize an independent owning tensor from a readable tensor view.
The destination's scalar, extents, storage, layout, and accessor policies are fixed by this specialization. Values are copied through the ordinary backend-dispatch path.
| InputTensor | Readable tensor-level source with matching static rank. |
| input | Source tensor view whose values are materialized. |
|
inlineexplicit |
Construct a zero-initialized tensor with default layout and accessor factory.
| exts | Extents that describe the tensor shape. |
| accessor_factory | Factory used to create the accessor for the storage handle. |
|
inlineexplicit |
Construct actual zeros at the supplied default working precision.
Fixed scalar types require their native precision and store no precision metadata.
|
inlineexplicit |
Allocate uninitialized elements with a compatible working precision.
Runtime scalars are unset placeholders; fixed scalars require native precision.
|
inlineexplicit |
Construct a dynamically shaped tensor with a trailing Precision argument.
|
inlineexplicit |
|
inlineexplicit |
Allocate the requested tensor shape without numerical initialization.
|
inlineexplicit |
Construct a tensor in an explicit storage context.
Context-bound storage policies use this form to retain device placement without hiding allocation or transfer decisions.
| Policy | Context-bound storage policy; defaults to this Tensor's policy. |
| context | Context used by the storage policy to allocate the buffer. |
| exts | Extents that describe the tensor shape. |
| accessor_factory | Factory used to create the accessor for the storage handle. |
|
inlineexplicit |
Allocate the requested tensor shape without numerical initialization.
|
inlineexplicit |
Construct a tensor with storage satisfying a placement value.
The storage policy interprets the placement and resolves any allocation resources needed to construct the buffer.
| Placement | Storage-policy placement value. |
| placement | Required storage placement. |
| exts | Extents that describe the tensor shape. |
| accessor_factory | Factory used to create the accessor for the storage handle. |
|
inlineexplicit |
Allocate the requested tensor shape without numerical initialization.
|
inlineexplicit |
Construct a fully dynamic tensor from one extent per axis.
This convenience form is available when every extent is dynamic and keeps rank-specific aliases ergonomic without adding wrapper classes solely for constructors.
| DynamicExtents | Integral extent arguments, one per tensor axis. |
| dynamic_extents | Tensor extents in axis order. |
|
inlineexplicit |
Allocate the requested tensor shape without numerical initialization.
|
inlineexplicit |
Construct a fully dynamic tensor in an explicit storage context.
| Policy | Context-bound storage policy; defaults to this Tensor's policy. |
| DynamicExtents | Integral extent arguments, one per tensor axis. |
| context | Context used by the storage policy to allocate the buffer. |
| dynamic_extents | Tensor extents in axis order. |
|
inlineexplicit |
Allocate the requested tensor shape without numerical initialization.
|
inlineexplicit |
Construct a tensor using a custom mapping builder.
| MappingBuilder | Callable that returns a mapping compatible with the layout policy. |
| exts | Extents that describe the tensor shape. |
| mapping_builder | Builder used to derive the mapping from the extents. |
| accessor_factory | Factory used to create the accessor for the storage handle. |
|
inlineexplicit |
Allocate the requested tensor shape without numerical initialization.
|
inlineexplicit |
Construct a tensor from explicit extents and strides.
| exts | Extents that describe the tensor shape. |
| strides | Stride specification per dimension for the layout mapping. |
| accessor_factory | Factory used to create the accessor for the storage handle. |
|
inlineexplicit |
Allocate the requested tensor shape without numerical initialization.
|
inlinenoexcept |
Construct the tensor's read-only accessor.
|
inlinenoexcept |
Construct the tensor's mutable accessor.
|
inlinestatic |
Adopt an existing storage container without reallocating it.
The storage may contain padding or an unused tail, but its logical size must cover the mapping's required span. The caller is responsible for ensuring that the mapping and accessor factory are valid for the transferred allocation.
| mapping | Mapping to expose through the adopted tensor. |
| storage | Storage container whose ownership is transferred. |
| accessor_factory | Factory used to resolve mdspan accessors. |
|
inlinestaticconstexprnoexcept |
Return the default backend selector associated with this tensor's storage.
|
inlinenoexcept |
Return the matrix column count for rank-two tensors.
|
inlinenoexcept |
Return contiguous read-only element storage for a canonical tensor.
This convenience is available only for immediately accessible layout_left or layout_right tensors using the ordinary default accessor and a pointer data handle. Other tensors must preserve mapping and accessor semantics through mdspan() or explicit access acquisition.
|
inlinenoexcept |
Return contiguous mutable element storage for a canonical tensor.
This convenience is available only for immediately accessible layout_left or layout_right tensors using the ordinary default accessor and a pointer data handle. Other tensors must preserve mapping and accessor semantics through mdspan() or explicit access acquisition.
|
inlinenoexcept |
Construct the accessor stored in a read-only mdspec.
|
inlinenoexcept |
Construct the accessor stored in a mutable mdspec.
|
inlinenoexcept |
Return one tensor extent.
| axis | Axis whose extent is requested. |
|
inlinenoexcept |
Return the tensor extents.
|
inlinenoexcept |
Return the tensor's const storage handle.
|
inlinenoexcept |
Return the tensor mapping.
|
inlinenoexcept |
Resolve a read-only mdspan over the owned storage.
|
inlinenoexcept |
Resolve a writable mdspan over the owned storage.
|
inlinenoexcept |
Return read-only mdspan metadata for explicit data-handle acquisition.
Immediate storage returns the ordinary const mdspan. Descriptor-backed storage returns mdspec without acquiring its handle.
|
inlinenoexcept |
Return mutable mdspan metadata for explicit data-handle acquisition.
Immediate storage returns the ordinary mdspan. Descriptor-backed storage returns mdspec without acquiring its handle.
|
inlinenoexcept |
Return the tensor's mutable storage handle.
|
default |
Move-assign tensor storage and descriptor state.
Existing non-owning views and mdspans into either tensor must not be used after ownership is transferred.
| other | Source tensor to move from. |
*this.
|
default |
Copy-assign tensor storage and descriptor state.
| other | Source tensor to copy. |
*this.
|
inlinenoexcept |
Access a const tensor element.
|
inlinenoexcept |
Access a mutable tensor element.
|
inlinenoexcept |
Access a const tensor element through an index array.
| indices | Coordinates for every tensor axis. |
|
inlinenoexcept |
Access a mutable tensor element through an index array.
| indices | Coordinates for every tensor axis. |
|
inlinestaticconstexprnoexcept |
Return the tensor rank.
|
inlinestaticconstexprnoexcept |
Return the number of dynamic extents.
|
inlinenoexcept |
Transfer the accessor-factory state out of this tensor.
This accompanies storage transfer when an owning operation rebinds the allocation to a different tensor descriptor.
|
inlinenoexcept |
Transfer the underlying storage container out of this tensor.
The mapping and accessor-factory state remain in the moved-from tensor. Existing views and mdspans into this tensor must not be used after the transfer.
storage_policy.
|
inline |
Replace tensor shape and storage to satisfy a placement requirement.
The replacement discards current values and uses the storage policy to allocate for placement. Construction completes before the current tensor state is swapped.
| Placement | Storage-policy placement value. |
| exts | New tensor extents. |
| placement | Required storage placement. |
|
inline |
Replace shape and placement with explicitly uninitialized storage.
|
inline |
Replace the tensor mapping without moving or reallocating storage.
Existing values are reinterpreted through the replacement mapping. The mapping's required span must fit the current allocation; higher-level operations establish any stronger ordering or contiguity requirements.
| mapping | Replacement mapping over the existing allocation. |
|
inline |
Replace the tensor shape and initialize its new elements to zero.
The replacement uses the storage policy's default mapping for the new extents and preserves accessor-factory state. The replacement is constructed before the current tensor changes; supported tensor state must be nothrow-swappable so the update provides the strong exception guarantee.
| exts | New tensor extents. |
|
inline |
Replace the shape with explicitly uninitialized storage.
|
inlinenoexcept |
Return the matrix row count for rank-two tensors.
|
inlinenoexcept |
Return the number of elements in the mapped storage span.
|
inlinenoexcept |
Access the owned storage container.
|
inlinenoexcept |
Access the owned storage container.
|
inline |
Report whether owned storage satisfies a placement requirement.
| Placement | Storage-policy placement value. |
| placement | Required storage placement. |
true when the current allocation may be retained.
|
staticconstexpr |
Whether const storage provides deferred read metadata.
|
staticconstexpr |
Whether mutable storage provides deferred write metadata.
|
staticconstexpr |
Whether const storage provides a readable data handle without acquisition.
|
staticconstexpr |
Whether mutable storage provides a writable data handle without acquisition.