16#ifndef CABANA_INDEX_HPP
17#define CABANA_INDEX_HPP
19#include <impl/Cabana_TypeTraits.hpp>
21#include <Kokkos_Core.hpp>
36template <
int VectorLength>
41 static_assert( Impl::IsVectorLengthValid<VectorLength>::value,
42 "Invalid vector length" );
52 Impl::LogBase2<vector_length>::value;
61 KOKKOS_FORCEINLINE_FUNCTION
62 static constexpr std::size_t
s(
const std::size_t
i )
76 KOKKOS_FORCEINLINE_FUNCTION
77 static constexpr std::size_t
a(
const std::size_t
i )
92 KOKKOS_FORCEINLINE_FUNCTION
93 static constexpr std::size_t
i(
const std::size_t
s,
const std::size_t
a )
Class for converting between 1d and 2d aosoa indices.
Definition Cabana_Index.hpp:38
static constexpr int vector_length_offset
Definition Cabana_Index.hpp:48
static KOKKOS_FORCEINLINE_FUNCTION constexpr std::size_t a(const std::size_t i)
Given a tuple index get the AoSoA array index.
Definition Cabana_Index.hpp:77
static KOKKOS_FORCEINLINE_FUNCTION constexpr std::size_t i(const std::size_t s, const std::size_t a)
Definition Cabana_Index.hpp:93
static KOKKOS_FORCEINLINE_FUNCTION constexpr std::size_t s(const std::size_t i)
Given a tuple index get the AoSoA struct index.
Definition Cabana_Index.hpp:62
static constexpr int vector_length_binary_bits
Definition Cabana_Index.hpp:51
static constexpr int vector_length
Definition Cabana_Index.hpp:45
Core: particle data structures and algorithms.
Definition Cabana_AoSoA.hpp:36