Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::Array1D< T, XLO, XHI > Class Template Reference

A GPU-compatible one-dimensional array. More...

#include <AMReX_Array.H>

Public Member Functions

__host__ __device__ const T * begin () const noexcept
 
__host__ __device__ const T * end () const noexcept
 
__host__ __device__ T * begin () noexcept
 
__host__ __device__ T * end () noexcept
 
__host__ __device__ const T & operator() (int i) const noexcept
 
__host__ __device__ T & operator() (int i) noexcept
 
__host__ __device__ constexpr T sum () const noexcept
 
__host__ __device__ constexpr T product () const noexcept
 

Static Public Member Functions

__host__ static __device__ constexpr unsigned int size () noexcept
 
__host__ static __device__ constexpr int lo () noexcept
 
__host__ static __device__ constexpr int hi () noexcept
 
__host__ static __device__ constexpr unsigned int len () noexcept
 

Detailed Description

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

A GPU-compatible one-dimensional array.

Array1D is a C-style array wrapper in a struct. It has no user-declared constructors. It's a trivial aggregate with a standard layout.

Template Parameters
TValue data type
XLOIndex for inclusive lower bound. Can be non-zero or negative.
XHIIndex for inclusive upper bound.

Member Function Documentation

◆ begin() [1/2]

template<class T , int XLO, int XHI>
__host__ __device__ 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>
__host__ __device__ 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>
__host__ __device__ 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>
__host__ __device__ 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>
__host__ static __device__ constexpr 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>
__host__ static __device__ constexpr 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>
__host__ static __device__ constexpr 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>
__host__ __device__ 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>
__host__ __device__ 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>
__host__ __device__ constexpr 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>
__host__ static __device__ constexpr 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>
__host__ __device__ constexpr T amrex::Array1D< T, XLO, XHI >::sum ( ) const
inlineconstexprnoexcept

Returns the sum of all elements in the Array1D object.


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