Low-Level Abstraction of Memory Access
llama::mapping::LinearizeArrayIndexRight Struct Reference

#include <Common.hpp>

Public Member Functions

template<typename ArrayExtents >
constexpr auto size (const ArrayExtents &extents) -> typename ArrayExtents::value_type
 
template<typename ArrayExtents >
constexpr auto operator() (const typename ArrayExtents::Index &ai, const ArrayExtents &extents) const -> typename ArrayExtents::value_type
 

Detailed Description

Functor that maps an ArrayIndex into linear numbers, where the fast moving index should be the rightmost one, which models how C++ arrays work and is analogous to mdspan's layout_right. E.g. ArrayIndex<3> a; stores 3 indices where a[2] should be incremented in the innermost loop.

Definition at line 45 of file Common.hpp.

Member Function Documentation

◆ operator()()

template<typename ArrayExtents >
constexpr auto llama::mapping::LinearizeArrayIndexRight::operator() ( const typename ArrayExtents::Index ai,
const ArrayExtents extents 
) const -> typename ArrayExtents::value_type
inlineconstexpr
Parameters
aiIndex in the array dimensions.
extentsTotal size of the array dimensions.
Returns
Linearized index.

Definition at line 57 of file Common.hpp.

◆ size()

template<typename ArrayExtents >
constexpr auto llama::mapping::LinearizeArrayIndexRight::size ( const ArrayExtents extents) -> typename ArrayExtents::value_type
inlineconstexpr

Definition at line 48 of file Common.hpp.


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