Cabana 0.8.0-dev
 
Loading...
Searching...
No Matches
Cabana::Impl::Index< VectorLength > Class Template Reference

Class for converting between 1d and 2d aosoa indices. More...

#include <Cabana_Index.hpp>

Static Public Member Functions

static KOKKOS_FORCEINLINE_FUNCTION constexpr std::size_t s (const std::size_t i)
 Given a tuple index get the AoSoA struct index.
 
static KOKKOS_FORCEINLINE_FUNCTION constexpr std::size_t a (const std::size_t i)
 Given a tuple index get the AoSoA array index.
 
static KOKKOS_FORCEINLINE_FUNCTION constexpr std::size_t i (const std::size_t s, const std::size_t a)
 Given a struct index and array index in an AoSoA get the tuple index.
 

Static Public Attributes

static constexpr int vector_length = VectorLength
 Inner array size.
 
static constexpr int vector_length_offset = ( vector_length - 1 )
 Array size offset.
 
static constexpr int vector_length_binary_bits
 Number of binary bits needed to hold the array size.
 

Detailed Description

template<int VectorLength>
class Cabana::Impl::Index< VectorLength >

Class for converting between 1d and 2d aosoa indices.

Template Parameters
VectorLengthThe inner array size of the AoSoA.

Member Function Documentation

◆ a()

template<int VectorLength>
static KOKKOS_FORCEINLINE_FUNCTION constexpr std::size_t Cabana::Impl::Index< VectorLength >::a ( const std::size_t i)
inlinestaticconstexpr

Given a tuple index get the AoSoA array index.

Parameters
iThe tuple index.
Returns
The index of the array index in the struct in which the tuple is located.

◆ i()

template<int VectorLength>
static KOKKOS_FORCEINLINE_FUNCTION constexpr std::size_t Cabana::Impl::Index< VectorLength >::i ( const std::size_t s,
const std::size_t a )
inlinestaticconstexpr

Given a struct index and array index in an AoSoA get the tuple index.

Parameters
sThe struct index.
aThe array index.
Returns
The tuple index.

◆ s()

template<int VectorLength>
static KOKKOS_FORCEINLINE_FUNCTION constexpr std::size_t Cabana::Impl::Index< VectorLength >::s ( const std::size_t i)
inlinestaticconstexpr

Given a tuple index get the AoSoA struct index.

Parameters
iThe tuple index.
Returns
The index of the struct in which the tuple is located.

Member Data Documentation

◆ vector_length_binary_bits

template<int VectorLength>
int Cabana::Impl::Index< VectorLength >::vector_length_binary_bits
staticconstexpr
Initial value:
=
Impl::LogBase2<vector_length>::value

Number of binary bits needed to hold the array size.


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