Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor > Class Template Reference

Store a data descriptor with the mapping and accessor for an eventual mdspan. More...

#include <mdspec.hpp>

Public Types

using accessor_type = Accessor
 
using data_descriptor_type = DataDescriptor
 
using data_handle_type = typename accessor_type::data_handle_type
 
using element_type = ElementType
 
using extents_type = Extents
 
using index_type = typename extents_type::index_type
 
using layout_type = LayoutPolicy
 
using mapping_type = typename layout_type::template mapping< extents_type >
 
using rank_type = typename extents_type::rank_type
 
using reference = typename accessor_type::reference
 
using size_type = typename extents_type::size_type
 
using value_type = std::remove_cv_t< element_type >
 

Public Member Functions

constexpr auto accessor () const noexcept -> accessor_type const &
 Return the stored accessor policy.
 
constexpr auto data_descriptor () const noexcept -> data_descriptor_type const &
 Return the descriptor used to acquire read-only data access.
 
constexpr auto data_descriptor () noexcept -> data_descriptor_type &
 Return the descriptor used to acquire writable data access.
 
constexpr index_type extent (rank_type axis) const noexcept
 Return the runtime extent of one axis.
 
constexpr auto extents () const noexcept -> extents_type const &
 Return the stored extents.
 
constexpr bool is_exhaustive () const noexcept
 Report whether this mapping is exhaustive.
 
constexpr bool is_strided () const noexcept
 Report whether this mapping is strided.
 
constexpr bool is_unique () const noexcept
 Report whether this mapping is unique.
 
constexpr auto mapping () const noexcept -> mapping_type const &
 Return the stored layout mapping.
 
constexpr mdspec (data_descriptor_type descriptor, mapping_type mapping, accessor_type accessor)
 Construct unresolved mdspan metadata from its three stored components.
 
constexpr index_type stride (rank_type axis) const
 Return the stride for one axis when the mapping exposes strides.
 

Static Public Member Functions

static constexpr bool is_always_exhaustive () noexcept
 Report whether every mapping of this type is exhaustive.
 
static constexpr bool is_always_strided () noexcept
 Report whether every mapping of this type is strided.
 
static constexpr bool is_always_unique () noexcept
 Report whether every mapping of this type is unique.
 
static constexpr rank_type rank () noexcept
 Return the static rank.
 
static constexpr rank_type rank_dynamic () noexcept
 Return the number of dynamic extents.
 
static constexpr std::size_t static_extent (rank_type axis) noexcept
 Return the compile-time extent for one axis.
 

Detailed Description

template<class ElementType, class Extents, class LayoutPolicy, AccessorPolicy Accessor, class DataDescriptor>
requires std::same_as<ElementType, typename Accessor::element_type>
class uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >

Store a data descriptor with the mapping and accessor for an eventual mdspan.

Unlike an mdspan, this type has no data-handle value and provides no element indexing. Domain-specific access acquisition uses data_descriptor(), then combines the acquired handle with mapping() and accessor() to construct a genuine mdspan.

Template Parameters
ElementTypeElement type presented by the eventual mdspan.
ExtentsExtents type of the eventual mdspan.
LayoutPolicyLayout policy whose mapping is stored.
AccessorAccessor policy stored for the eventual mdspan.
DataDescriptorDescriptor identifying the region from which a handle can be acquired.

Member Typedef Documentation

◆ accessor_type

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
using uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::accessor_type = Accessor

◆ data_descriptor_type

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
using uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::data_descriptor_type = DataDescriptor

◆ data_handle_type

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
using uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::data_handle_type = typename accessor_type::data_handle_type

◆ element_type

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
using uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::element_type = ElementType

◆ extents_type

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
using uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::extents_type = Extents

◆ index_type

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
using uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::index_type = typename extents_type::index_type

◆ layout_type

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
using uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::layout_type = LayoutPolicy

◆ mapping_type

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
using uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::mapping_type = typename layout_type::template mapping<extents_type>

◆ rank_type

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
using uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::rank_type = typename extents_type::rank_type

◆ reference

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
using uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::reference = typename accessor_type::reference

◆ size_type

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
using uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::size_type = typename extents_type::size_type

◆ value_type

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
using uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::value_type = std::remove_cv_t<element_type>

Constructor & Destructor Documentation

◆ mdspec()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
constexpr uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::mdspec ( data_descriptor_type  descriptor,
mapping_type  mapping,
accessor_type  accessor 
)
inlineexplicitconstexpr

Construct unresolved mdspan metadata from its three stored components.

Parameters
descriptorDescriptor used by later access acquisition.
mappingMapping installed in the eventual mdspan.
accessorAccessor installed in the eventual mdspan.

Member Function Documentation

◆ accessor()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
constexpr auto uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::accessor ( ) const -> accessor_type const&
inlineconstexprnoexcept

Return the stored accessor policy.

◆ data_descriptor() [1/2]

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
constexpr auto uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::data_descriptor ( ) const -> data_descriptor_type const&
inlineconstexprnoexcept

Return the descriptor used to acquire read-only data access.

◆ data_descriptor() [2/2]

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
constexpr auto uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::data_descriptor ( ) -> data_descriptor_type&
inlineconstexprnoexcept

Return the descriptor used to acquire writable data access.

◆ extent()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
constexpr index_type uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::extent ( rank_type  axis) const
inlineconstexprnoexcept

Return the runtime extent of one axis.

Parameters
axisAxis whose extent is requested.

◆ extents()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
constexpr auto uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::extents ( ) const -> extents_type const&
inlineconstexprnoexcept

Return the stored extents.

◆ is_always_exhaustive()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
static constexpr bool uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::is_always_exhaustive ( )
inlinestaticconstexprnoexcept

Report whether every mapping of this type is exhaustive.

◆ is_always_strided()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
static constexpr bool uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::is_always_strided ( )
inlinestaticconstexprnoexcept

Report whether every mapping of this type is strided.

◆ is_always_unique()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
static constexpr bool uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::is_always_unique ( )
inlinestaticconstexprnoexcept

Report whether every mapping of this type is unique.

◆ is_exhaustive()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
constexpr bool uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::is_exhaustive ( ) const
inlineconstexprnoexcept

Report whether this mapping is exhaustive.

◆ is_strided()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
constexpr bool uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::is_strided ( ) const
inlineconstexprnoexcept

Report whether this mapping is strided.

◆ is_unique()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
constexpr bool uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::is_unique ( ) const
inlineconstexprnoexcept

Report whether this mapping is unique.

◆ mapping()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
constexpr auto uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::mapping ( ) const -> mapping_type const&
inlineconstexprnoexcept

Return the stored layout mapping.

◆ rank()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
static constexpr rank_type uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::rank ( )
inlinestaticconstexprnoexcept

Return the static rank.

◆ rank_dynamic()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
static constexpr rank_type uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::rank_dynamic ( )
inlinestaticconstexprnoexcept

Return the number of dynamic extents.

◆ static_extent()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
static constexpr std::size_t uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::static_extent ( rank_type  axis)
inlinestaticconstexprnoexcept

Return the compile-time extent for one axis.

Parameters
axisAxis whose static extent is requested.

◆ stride()

template<class ElementType , class Extents , class LayoutPolicy , AccessorPolicy Accessor, class DataDescriptor >
constexpr index_type uni20::mdspec< ElementType, Extents, LayoutPolicy, Accessor, DataDescriptor >::stride ( rank_type  axis) const
inlineconstexpr

Return the stride for one axis when the mapping exposes strides.

Parameters
axisAxis whose stride is requested.

The documentation for this class was generated from the following file: