21template <
class T>
using tensor_type_t = std::remove_reference_t<T>;
23template <
class Tensor,
class =
void>
struct TensorStoragePolicy
28template <
class Tensor>
struct TensorStoragePolicy<
Tensor,
std::void_t<typename Tensor::storage_policy>>
33template <
class T>
using tensor_const_mdspan_t =
decltype(std::declval<tensor_type_t<T>
const&>().mdspan());
35template <
class T>
using tensor_mutable_mdspan_t =
decltype(std::declval<tensor_type_t<T>&>().mdspan());
39template <
class Tensor>
48template <
class Tensor>
49 requires requires(
Tensor& tensor) { tensor.mdspec(); }
61template <
class Tensor>
63 !
requires(Tensor& tensor) { tensor.
mdspec(); } &&
requires(
Tensor& tensor) { tensor.
mdspan(); })
71template <
class T>
using normalized_const_mdspec_t =
decltype(
mdspec_of(std::declval<tensor_type_t<T>
const&>()));
73template <
class T>
using normalized_mutable_mdspec_t =
decltype(
mdspec_of(std::declval<tensor_type_t<T>&>()));
83 typename std::remove_cvref_t<detail::normalized_const_mdspec_t<T>>::extents_type;
84 tensor.backend_selector();
88 } -> std::convertible_to<typename std::remove_cvref_t<detail::normalized_const_mdspec_t<T>>::extents_type>;
90 tensor.extent(std::size_t{})
91 } -> std::convertible_to<typename std::remove_cvref_t<detail::normalized_const_mdspec_t<T>>
::index_type>;
119template <ImmediateTensorView T>
123template <TensorView T>
using tensor_mdspec_t = std::remove_cvref_t<detail::normalized_const_mdspec_t<T>>;
126template <TensorView T>
using tensor_element_t = std::remove_cv_t<typename tensor_mdspec_t<T>::element_type>;
140 requires(std::remove_reference_t<T>& tensor) { tensor.mdspan(); } &&
144template <MutableTensorView T>
148template <
class T, std::
size_t Rank>
161template <
class T, std::
size_t Rank>
165template <
class T, std::
size_t Rank>
178template <
class T, std::
size_t Rank>
182template <MutableImmediateTensorView T>
189 StridedMdspanLike<
decltype(std::declval<std::remove_reference_t<T>
const&>().mdspan())>;
200template <
class T, std::
size_t Rank>
203 RankedMdspanLike<
decltype(std::declval<std::remove_reference_t<T>
const&>().mdspan()), Rank>;
208template <
class T, std::
size_t Rank>
222template <
class T, std::
size_t Rank>
227template <
class T, std::
size_t Rank>
241template <MutableTensorView Output, TensorView Input>
242 requires(tensor_mdspec_t<Output>::rank() == tensor_mdspec_t<Input>::rank())
General-purpose owning tensor with immediate or deferred mdspan metadata.
Definition basic_tensor.hpp:109
auto mdspec() noexcept
Return mutable mdspan metadata for explicit data-handle acquisition.
Definition basic_tensor.hpp:626
StoragePolicy storage_policy
Definition basic_tensor.hpp:115
auto mdspan() noexcept -> mdspan_type
Resolve a writable mdspan over the owned storage.
Definition basic_tensor.hpp:609
A readable type implementing the mdspan observers and multidimensional subscript contract.
Definition mdspan/concepts.hpp:291
Mdspan metadata whose data handle is immediate or available through a data descriptor.
Definition mdspan/concepts.hpp:304
MdspanLike types whose accessor supports indexed assignment.
Definition mdspan/concepts.hpp:387
MdspecLike types whose eventual storage supports writes.
Definition mdspan/concepts.hpp:398
A mutable mdspan-like type with a specified static rank.
Definition mdspan/concepts.hpp:494
Mutable mdspec-like type with a specified static rank.
Definition mdspan/concepts.hpp:487
Mutable strided TensorView with a specified static rank.
Definition tensor/concepts.hpp:179
MutableTensorView with a specified static rank.
Definition tensor/concepts.hpp:166
MutableTensorView whose writable mdspec has rank zero.
Definition tensor/concepts.hpp:175
Mutable mdspan-like types whose layout reports they are always strided.
Definition mdspan/concepts.hpp:421
Mutable mdspec-like type whose mapping is always strided.
Definition mdspan/concepts.hpp:440
MutableTensorView whose readable and writable mdspecs are strided.
Definition tensor/concepts.hpp:157
TensorView whose writable mdspec supports eventual element assignment.
Definition tensor/concepts.hpp:133
Tensor-level object that owns the storage described by its multidimensional view.
Definition tensor/concepts.hpp:116
An mdspan-like type with a specified static rank.
Definition mdspan/concepts.hpp:447
An mdspec-like type with a specified static rank.
Definition mdspan/concepts.hpp:454
StridedTensorView with a specified static rank.
Definition tensor/concepts.hpp:162
TensorView whose readable mdspec has a specified static rank.
Definition tensor/concepts.hpp:149
TensorView whose readable mdspec has rank zero.
Definition tensor/concepts.hpp:171
An mdspan-like type whose mapping is always strided and exposes stride observers.
Definition mdspan/concepts.hpp:406
An mdspec-like type whose mapping exposes multidimensional strides.
Definition mdspan/concepts.hpp:427
TensorView whose readable mdspec is strided.
Definition tensor/concepts.hpp:153
Tensor-level object exposing readable multidimensional metadata and a backend selector.
Definition tensor/concepts.hpp:82
auto strides(S const &s)
Retrieve the strides associated with a strided mdspec-like type.
Definition mdspan/concepts.hpp:558
Mdspan concept and accessor extensions for Uni20.
Definition async/async.hpp:26
typename detail::TensorStoragePolicy< std::remove_cvref_t< Tensor > >::type tensor_storage_policy_t
Storage-policy type exposed by a tensor-level object, or void.
Definition tensor/concepts.hpp:40
std::remove_cvref_t< detail::normalized_mutable_mdspec_t< T > > mutable_tensor_mdspec_t
Normalized writable MdspecLike type exposed by a mutable tensor-level object.
Definition tensor/concepts.hpp:145
constexpr bool enable_owning_tensor
Opt-in marker for tensor types that own their storage and lifetime.
Definition tensor/concepts.hpp:108
typename tensor_mdspec_t< T >::extents_type tensor_extents_t
Extents type exposed by a tensor-level object.
Definition tensor/concepts.hpp:129
void assign_through(Output &output, Input const &input)
Assign tensor values through a mutable tensor alias descriptor.
Definition copy_into.hpp:121
constexpr decltype(auto) mdspec_of(Tensor &tensor) noexcept(noexcept(tensor.mdspec()))
Return a tensor's immediate or descriptor-backed multidimensional metadata.
Definition tensor/concepts.hpp:50
std::remove_cvref_t< detail::tensor_mutable_mdspan_t< T > > mutable_immediate_tensor_mdspan_t
Resolved writable mdspan type exposed by a mutable tensor-level object.
Definition tensor/concepts.hpp:183
std::remove_cv_t< typename tensor_mdspec_t< T >::element_type > tensor_element_t
Scalar value type exposed by a tensor-level object.
Definition tensor/concepts.hpp:126
std::ptrdiff_t index_type
Definition types.hpp:19
Tensor(InputTensor const &) -> Tensor< tensor_element_t< InputTensor >, tensor_mdspec_t< InputTensor >::rank(), HostStorage, detail::materialized_layout_t< void, tensor_mdspec_t< InputTensor > >, DefaultAccessorFactory >
Deduce a runtime-extents host tensor that materializes a tensor view.
std::remove_cvref_t< detail::tensor_const_mdspan_t< T > > immediate_tensor_mdspan_t
Resolved readable mdspan type exposed by a tensor-level object.
Definition tensor/concepts.hpp:120
std::remove_cvref_t< detail::normalized_const_mdspec_t< T > > tensor_mdspec_t
Normalized readable MdspecLike type exposed by a tensor-level object.
Definition tensor/concepts.hpp:123