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

Compact read-only tensor evaluated from logical indices. More...

#include <generated.hpp>

Public Types

using accessor_type = generated_accessor< element_type, extents_type, generator_type >
 
using backend_selector_type = typename storage_policy::backend_selector_type
 
using element_type = ElementType
 
using extents_type = Extents
 
using generator_type = Generator
 
using index_type = typename extents_type::index_type
 
using layout_type = GeneratedLayout
 
using mapping_type = typename layout_type::template mapping< extents_type >
 
using mdspan_type = stdex::mdspan< element_type const, extents_type, layout_type, accessor_type >
 
using storage_policy = GeneratedStorage
 
using value_type = element_type
 

Public Member Functions

constexpr auto extent (std::size_t axis) const noexcept -> index_type
 Return one generated tensor extent.
 
constexpr auto extents () const noexcept -> extents_type const &
 Return the generated tensor extents.
 
constexpr GeneratedTensor (extents_type extents, generator_type generator)
 Construct from extents and compact generator state.
 
constexpr auto mdspan () const -> mdspan_type
 Resolve a self-contained generated mdspan descriptor.
 
template<class... Index>
requires (sizeof...(Index) == extents_type::rank())
constexpr element_type operator[] (Index... indices) const
 Evaluate one generated tensor element.
 

Static Public Member Functions

static constexpr auto backend_selector () noexcept -> backend_selector_type
 Return the host fallback selector used when no concrete storage operand is present.
 
static constexpr std::size_t rank () noexcept
 Return the tensor's static rank.
 

Detailed Description

template<Scalar ElementType, class Extents, class Generator>
class uni20::GeneratedTensor< ElementType, Extents, Generator >

Compact read-only tensor evaluated from logical indices.

The tensor owns its extents and generator state but no dense element allocation. Its generated storage is backend-neutral and its resolved mdspan returns values by value.

Member Typedef Documentation

◆ accessor_type

template<Scalar ElementType, class Extents , class Generator >
using uni20::GeneratedTensor< ElementType, Extents, Generator >::accessor_type = generated_accessor<element_type, extents_type, generator_type>

◆ backend_selector_type

template<Scalar ElementType, class Extents , class Generator >
using uni20::GeneratedTensor< ElementType, Extents, Generator >::backend_selector_type = typename storage_policy::backend_selector_type

◆ element_type

template<Scalar ElementType, class Extents , class Generator >
using uni20::GeneratedTensor< ElementType, Extents, Generator >::element_type = ElementType

◆ extents_type

template<Scalar ElementType, class Extents , class Generator >
using uni20::GeneratedTensor< ElementType, Extents, Generator >::extents_type = Extents

◆ generator_type

template<Scalar ElementType, class Extents , class Generator >
using uni20::GeneratedTensor< ElementType, Extents, Generator >::generator_type = Generator

◆ index_type

template<Scalar ElementType, class Extents , class Generator >
using uni20::GeneratedTensor< ElementType, Extents, Generator >::index_type = typename extents_type::index_type

◆ layout_type

template<Scalar ElementType, class Extents , class Generator >
using uni20::GeneratedTensor< ElementType, Extents, Generator >::layout_type = GeneratedLayout

◆ mapping_type

template<Scalar ElementType, class Extents , class Generator >
using uni20::GeneratedTensor< ElementType, Extents, Generator >::mapping_type = typename layout_type::template mapping<extents_type>

◆ mdspan_type

template<Scalar ElementType, class Extents , class Generator >
using uni20::GeneratedTensor< ElementType, Extents, Generator >::mdspan_type = stdex::mdspan<element_type const, extents_type, layout_type, accessor_type>

◆ storage_policy

template<Scalar ElementType, class Extents , class Generator >
using uni20::GeneratedTensor< ElementType, Extents, Generator >::storage_policy = GeneratedStorage

◆ value_type

template<Scalar ElementType, class Extents , class Generator >
using uni20::GeneratedTensor< ElementType, Extents, Generator >::value_type = element_type

Constructor & Destructor Documentation

◆ GeneratedTensor()

template<Scalar ElementType, class Extents , class Generator >
constexpr uni20::GeneratedTensor< ElementType, Extents, Generator >::GeneratedTensor ( extents_type  extents,
generator_type  generator 
)
inlineconstexpr

Construct from extents and compact generator state.

Member Function Documentation

◆ backend_selector()

template<Scalar ElementType, class Extents , class Generator >
static constexpr auto uni20::GeneratedTensor< ElementType, Extents, Generator >::backend_selector ( ) -> backend_selector_type
inlinestaticconstexprnoexcept

Return the host fallback selector used when no concrete storage operand is present.

◆ extent()

template<Scalar ElementType, class Extents , class Generator >
constexpr auto uni20::GeneratedTensor< ElementType, Extents, Generator >::extent ( std::size_t  axis) const -> index_type
inlineconstexprnoexcept

Return one generated tensor extent.

◆ extents()

template<Scalar ElementType, class Extents , class Generator >
constexpr auto uni20::GeneratedTensor< ElementType, Extents, Generator >::extents ( ) const -> extents_type const&
inlineconstexprnoexcept

Return the generated tensor extents.

◆ mdspan()

template<Scalar ElementType, class Extents , class Generator >
constexpr auto uni20::GeneratedTensor< ElementType, Extents, Generator >::mdspan ( ) const -> mdspan_type
inlineconstexpr

Resolve a self-contained generated mdspan descriptor.

◆ operator[]()

template<Scalar ElementType, class Extents , class Generator >
template<class... Index>
requires (sizeof...(Index) == extents_type::rank())
constexpr element_type uni20::GeneratedTensor< ElementType, Extents, Generator >::operator[] ( Index...  indices) const
inlineconstexpr

Evaluate one generated tensor element.

◆ rank()

template<Scalar ElementType, class Extents , class Generator >
static constexpr std::size_t uni20::GeneratedTensor< ElementType, Extents, Generator >::rank ( )
inlinestaticconstexprnoexcept

Return the tensor's static rank.


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