AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::StackArray< T, N > Class Template Reference

Provides a wrapper for a compile time sized array, similar to std::array. This class is needed because NVCC doesn't capture standard stack arrays in device lambdas. Furthermore we can't use std::array because it is not host-device decorated. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/feature-whitlock-mir_update/src/axom/core/StackArray.hpp>

Inheritance diagram for axom::StackArray< T, N >:

Public Types

using value_type = T
 

Public Member Functions

AXOM_HOST_DEVICE T & operator[] (IndexType i) noexcept
 Accessor, returns a reference to the value at the given index. More...
 
constexpr AXOM_HOST_DEVICE const T & operator[] (IndexType i) const noexcept
 
AXOM_HOST_DEVICE operator T* () noexcept
 User defined conversion to a raw pointer. More...
 
constexpr AXOM_HOST_DEVICE operator const T * () const noexcept
 
AXOM_HOST_DEVICE T * data () noexcept
 
AXOM_HOST_DEVICE const T * data () const noexcept
 
AXOM_HOST_DEVICE T * begin () noexcept
 Begin/end iterators. More...
 
AXOM_HOST_DEVICE const T * begin () const noexcept
 
AXOM_HOST_DEVICE T * end () noexcept
 
AXOM_HOST_DEVICE const T * end () const noexcept
 

Static Public Member Functions

constexpr static AXOM_HOST_DEVICE int size ()
 Return size of the array. More...
 

Public Attributes

m_data [N]
 

Detailed Description

template<typename T, int N>
class axom::StackArray< T, N >

Provides a wrapper for a compile time sized array, similar to std::array. This class is needed because NVCC doesn't capture standard stack arrays in device lambdas. Furthermore we can't use std::array because it is not host-device decorated.

Template Parameters
Tthe type of the values to hold.
Nthe number of values in the array.

Member Typedef Documentation

◆ value_type

template<typename T , int N>
using axom::StackArray< T, N >::value_type = T

Member Function Documentation

◆ size()

template<typename T , int N>
constexpr static AXOM_HOST_DEVICE int axom::StackArray< T, N >::size ( )
inlinestaticconstexpr

Return size of the array.

◆ operator[]() [1/2]

template<typename T , int N>
AXOM_HOST_DEVICE T& axom::StackArray< T, N >::operator[] ( IndexType  i)
inlinenoexcept

Accessor, returns a reference to the value at the given index.

Parameters
[in]ithe index to access.

References axom::StackArray< T, N >::m_data.

◆ operator[]() [2/2]

template<typename T , int N>
constexpr AXOM_HOST_DEVICE const T& axom::StackArray< T, N >::operator[] ( IndexType  i) const
inlineconstexprnoexcept

◆ operator T*()

template<typename T , int N>
AXOM_HOST_DEVICE axom::StackArray< T, N >::operator T* ( )
inlinenoexcept

User defined conversion to a raw pointer.

◆ operator const T *()

template<typename T , int N>
constexpr AXOM_HOST_DEVICE axom::StackArray< T, N >::operator const T * ( ) const
inlineconstexprnoexcept

◆ data() [1/2]

template<typename T , int N>
AXOM_HOST_DEVICE T* axom::StackArray< T, N >::data ( )
inlinenoexcept

◆ data() [2/2]

template<typename T , int N>
AXOM_HOST_DEVICE const T* axom::StackArray< T, N >::data ( ) const
inlinenoexcept

◆ begin() [1/2]

template<typename T , int N>
AXOM_HOST_DEVICE T* axom::StackArray< T, N >::begin ( )
inlinenoexcept

Begin/end iterators.

References axom::StackArray< T, N >::m_data.

◆ begin() [2/2]

template<typename T , int N>
AXOM_HOST_DEVICE const T* axom::StackArray< T, N >::begin ( ) const
inlinenoexcept

◆ end() [1/2]

template<typename T , int N>
AXOM_HOST_DEVICE T* axom::StackArray< T, N >::end ( )
inlinenoexcept

◆ end() [2/2]

template<typename T , int N>
AXOM_HOST_DEVICE const T* axom::StackArray< T, N >::end ( ) const
inlinenoexcept

Member Data Documentation

◆ m_data

template<typename T , int N>
T axom::StackArray< T, N >::m_data[N]

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