Block-Structured AMR Software Framework
amrex::Array1D< T, XLO, XHI > Struct Template Reference

#include <AMReX_Array.H>

Public Member Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * begin () const noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * end () const noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * begin () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * end () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T & operator() (int i) const noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T & operator() (int i) noexcept
 
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINEsum () const noexcept
 
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINEproduct () const noexcept
 

Static Public Member Functions

AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int size () noexcept
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int lo () noexcept
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int hi () noexcept
 
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int len () noexcept
 

Public Attributes

arr [(XHI-XLO+1)]
 

Detailed Description

template<class T, int XLO, int XHI>
struct amrex::Array1D< T, XLO, XHI >

A GPU-compatible one-dimensional array.

Template Parameters
XLOIndex for lower bound. Can be other than 0.
XHIIndex for upper bound.

Member Function Documentation

◆ begin() [1/2]

template<class T , int XLO, int XHI>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T* amrex::Array1D< T, XLO, XHI >::begin ( ) const
inlinenoexcept

Returns a const pointer address to the first element of the Array1D object.

◆ begin() [2/2]

template<class T , int XLO, int XHI>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T* amrex::Array1D< T, XLO, XHI >::begin ( )
inlinenoexcept

Returns a pointer address to the first element of the Array1D object.

◆ end() [1/2]

template<class T , int XLO, int XHI>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T* amrex::Array1D< T, XLO, XHI >::end ( ) const
inlinenoexcept

Returns a const pointer address right after the last element of the Array1D object.

◆ end() [2/2]

template<class T , int XLO, int XHI>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T* amrex::Array1D< T, XLO, XHI >::end ( )
inlinenoexcept

Returns a pointer address right after the last element of the Array1D object.

◆ hi()

template<class T , int XLO, int XHI>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int amrex::Array1D< T, XLO, XHI >::hi ( )
inlinestaticconstexprnoexcept

Returns the index of the upper bound of the Array1D object.

◆ len()

template<class T , int XLO, int XHI>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int amrex::Array1D< T, XLO, XHI >::len ( )
inlinestaticconstexprnoexcept

Returns the number of elements in the Array1D object as an unsigned integer.

◆ lo()

template<class T , int XLO, int XHI>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int amrex::Array1D< T, XLO, XHI >::lo ( )
inlinestaticconstexprnoexcept

Returns the index of the lower bound of the Array1D object. Can be other than 0.

◆ operator()() [1/2]

template<class T , int XLO, int XHI>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T& amrex::Array1D< T, XLO, XHI >::operator() ( int  i) const
inlinenoexcept

The elements of an Array1D object are accessed using parentheses, e.g. array(i), instead of using square brackets.

◆ operator()() [2/2]

template<class T , int XLO, int XHI>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T& amrex::Array1D< T, XLO, XHI >::operator() ( int  i)
inlinenoexcept

The elements of an Array1D object are accessed using parentheses, e.g. array(i), instead of using square brackets.

◆ product()

template<class T , int XLO, int XHI>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T amrex::Array1D< T, XLO, XHI >::product ( ) const
inlineconstexprnoexcept

Returns the product of all elements in the Array1D object.

◆ size()

template<class T , int XLO, int XHI>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int amrex::Array1D< T, XLO, XHI >::size ( )
inlinestaticconstexprnoexcept

Returns the number of elements in the Array1D object as an unsigned integer.

◆ sum()

template<class T , int XLO, int XHI>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T amrex::Array1D< T, XLO, XHI >::sum ( ) const
inlineconstexprnoexcept

Returns the sum of all elements in the Array1D object.

Member Data Documentation

◆ arr

template<class T , int XLO, int XHI>
T amrex::Array1D< T, XLO, XHI >::arr[(XHI-XLO+1)]

Array1D is implemented as a fixed-size array. Hence, no constructor or destructor is given.


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