29template <
class ElementType,
class Extents,
class LayoutPolicy, AccessorPolicy Accessor,
class DataDescriptor>
30 requires std::same_as<ElementType, typename Accessor::element_type>
37 using mapping_type =
typename layout_type::template mapping<extents_type>;
41 using reference =
typename accessor_type::reference;
55 [[nodiscard]]
static constexpr rank_type rank() noexcept {
return extents_type::rank(); }
64 return extents_type::static_extent(axis);
68 [[nodiscard]]
static constexpr bool is_always_unique() noexcept {
return mapping_type::is_always_unique(); }
71 [[nodiscard]]
static constexpr bool is_always_exhaustive() noexcept {
return mapping_type::is_always_exhaustive(); }
74 [[nodiscard]]
static constexpr bool is_always_strided() noexcept {
return mapping_type::is_always_strided(); }
89 [[nodiscard]]
constexpr auto extents() const noexcept ->
extents_type const& {
return mapping_.extents(); }
96 [[nodiscard]]
constexpr bool is_unique() const noexcept {
return mapping_.is_unique(); }
99 [[nodiscard]]
constexpr bool is_exhaustive() const noexcept {
return mapping_.is_exhaustive(); }
102 [[nodiscard]]
constexpr bool is_strided() const noexcept {
return mapping_.is_strided(); }
108 {
mapping.stride(axis) } -> std::convertible_to<index_type>;
111 return mapping_.stride(axis);
Store a data descriptor with the mapping and accessor for an eventual mdspan.
Definition mdspec.hpp:31
constexpr bool is_strided() const noexcept
Report whether this mapping is strided.
Definition mdspec.hpp:102
LayoutPolicy layout_type
Definition mdspec.hpp:36
constexpr index_type extent(rank_type axis) const noexcept
Return the runtime extent of one axis.
Definition mdspec.hpp:93
DataDescriptor data_descriptor_type
Definition mdspec.hpp:39
constexpr index_type stride(rank_type axis) const
Return the stride for one axis when the mapping exposes strides.
Definition mdspec.hpp:106
typename extents_type::rank_type rank_type
Definition mdspec.hpp:44
static constexpr bool is_always_exhaustive() noexcept
Report whether every mapping of this type is exhaustive.
Definition mdspec.hpp:71
Extents extents_type
Definition mdspec.hpp:35
constexpr bool is_exhaustive() const noexcept
Report whether this mapping is exhaustive.
Definition mdspec.hpp:99
typename extents_type::size_type size_type
Definition mdspec.hpp:43
static constexpr rank_type rank() noexcept
Return the static rank.
Definition mdspec.hpp:55
ElementType element_type
Definition mdspec.hpp:33
typename accessor_type::data_handle_type data_handle_type
Definition mdspec.hpp:40
typename extents_type::index_type index_type
Definition mdspec.hpp:42
constexpr auto extents() const noexcept -> extents_type const &
Return the stored extents.
Definition mdspec.hpp:89
constexpr auto data_descriptor() noexcept -> data_descriptor_type &
Return the descriptor used to acquire writable data access.
Definition mdspec.hpp:77
constexpr auto mapping() const noexcept -> mapping_type const &
Return the stored layout mapping.
Definition mdspec.hpp:83
constexpr auto data_descriptor() const noexcept -> data_descriptor_type const &
Return the descriptor used to acquire read-only data access.
Definition mdspec.hpp:80
Accessor accessor_type
Definition mdspec.hpp:38
static constexpr rank_type rank_dynamic() noexcept
Return the number of dynamic extents.
Definition mdspec.hpp:58
std::remove_cv_t< element_type > value_type
Definition mdspec.hpp:34
constexpr bool is_unique() const noexcept
Report whether this mapping is unique.
Definition mdspec.hpp:96
typename layout_type::template mapping< extents_type > mapping_type
Definition mdspec.hpp:37
typename accessor_type::reference reference
Definition mdspec.hpp:41
constexpr mdspec(data_descriptor_type descriptor, mapping_type mapping, accessor_type accessor)
Construct unresolved mdspan metadata from its three stored components.
Definition mdspec.hpp:50
constexpr auto accessor() const noexcept -> accessor_type const &
Return the stored accessor policy.
Definition mdspec.hpp:86
static constexpr std::size_t static_extent(rank_type axis) noexcept
Return the compile-time extent for one axis.
Definition mdspec.hpp:62
static constexpr bool is_always_unique() noexcept
Report whether every mapping of this type is unique.
Definition mdspec.hpp:68
static constexpr bool is_always_strided() noexcept
Report whether every mapping of this type is strided.
Definition mdspec.hpp:74
Mdspan concept and accessor extensions for Uni20.
Definition async/async.hpp:26