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

Accessor that evaluates a generator at the logical index encoded by an offset. More...

#include <generated_accessor.hpp>

Public Types

using data_handle_type = generated_data_handle
 
using element_type = value_type const
 
using extents_type = Extents
 
using generator_type = Generator
 
using index_type = typename extents_type::index_type
 
using offset_policy = generated_accessor
 
using offset_type = std::size_t
 
using reference = value_type
 
using value_type = std::remove_cv_t< ElementType >
 

Public Member Functions

UNI20_HOST_DEVICE constexpr reference access (data_handle_type handle, offset_type offset) const
 Generate the value at a handle-relative synthetic offset.
 
UNI20_HOST_DEVICE constexpr auto extents () const noexcept -> extents_type const &
 Return the extents used to decode generated offsets.
 
UNI20_HOST_DEVICE constexpr generated_accessor ()=default
 
UNI20_HOST_DEVICE constexpr generated_accessor (extents_type extents, generator_type generator)
 Construct an accessor from the original extents and generator state.
 
UNI20_HOST_DEVICE constexpr auto generator () const noexcept -> generator_type const &
 Return the stored generator state.
 
UNI20_HOST_DEVICE constexpr data_handle_type offset (data_handle_type handle, offset_type offset) const noexcept
 Advance a generated handle while preserving its original index space.
 

Detailed Description

template<class ElementType, class Extents, class Generator>
class uni20::generated_accessor< ElementType, Extents, Generator >

Accessor that evaluates a generator at the logical index encoded by an offset.

Template Parameters
ElementTypeScalar value returned by the generator.
ExtentsMdspan extents used to decode linear offsets.
GeneratorCallable accepting an index array and returning an element value.

Member Typedef Documentation

◆ data_handle_type

template<class ElementType , class Extents , class Generator >
using uni20::generated_accessor< ElementType, Extents, Generator >::data_handle_type = generated_data_handle

◆ element_type

template<class ElementType , class Extents , class Generator >
using uni20::generated_accessor< ElementType, Extents, Generator >::element_type = value_type const

◆ extents_type

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

◆ generator_type

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

◆ index_type

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

◆ offset_policy

template<class ElementType , class Extents , class Generator >
using uni20::generated_accessor< ElementType, Extents, Generator >::offset_policy = generated_accessor

◆ offset_type

template<class ElementType , class Extents , class Generator >
using uni20::generated_accessor< ElementType, Extents, Generator >::offset_type = std::size_t

◆ reference

template<class ElementType , class Extents , class Generator >
using uni20::generated_accessor< ElementType, Extents, Generator >::reference = value_type

◆ value_type

template<class ElementType , class Extents , class Generator >
using uni20::generated_accessor< ElementType, Extents, Generator >::value_type = std::remove_cv_t<ElementType>

Constructor & Destructor Documentation

◆ generated_accessor() [1/2]

template<class ElementType , class Extents , class Generator >
UNI20_HOST_DEVICE constexpr uni20::generated_accessor< ElementType, Extents, Generator >::generated_accessor ( )
constexprdefault

◆ generated_accessor() [2/2]

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

Construct an accessor from the original extents and generator state.

Member Function Documentation

◆ access()

template<class ElementType , class Extents , class Generator >
UNI20_HOST_DEVICE constexpr reference uni20::generated_accessor< ElementType, Extents, Generator >::access ( data_handle_type  handle,
offset_type  offset 
) const
inlineconstexpr

Generate the value at a handle-relative synthetic offset.

◆ extents()

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

Return the extents used to decode generated offsets.

◆ generator()

template<class ElementType , class Extents , class Generator >
UNI20_HOST_DEVICE constexpr auto uni20::generated_accessor< ElementType, Extents, Generator >::generator ( ) const -> generator_type const&
inlineconstexprnoexcept

Return the stored generator state.

◆ offset()

template<class ElementType , class Extents , class Generator >
UNI20_HOST_DEVICE constexpr data_handle_type uni20::generated_accessor< ElementType, Extents, Generator >::offset ( data_handle_type  handle,
offset_type  offset 
) const
inlineconstexprnoexcept

Advance a generated handle while preserving its original index space.


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