Block-Structured AMR Software Framework
amrex::GpuArray< T, N > Struct Template Reference

#include <AMReX_Array.H>

Public Types

using value_type = T
 
using reference_type = T &
 

Public Member Functions

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 AMREX_FORCE_INLINE const T * data () const noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * data () noexcept
 
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 void fill (const T &value) noexcept
 
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINEsum () const noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINEproduct () const noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuArray< T, N > & operator+= (GpuArray< T, N > const &a) noexcept
 

Static Public Member Functions

AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int size () noexcept
 

Public Attributes

arr [amrex::max(N, 1U)]
 

Member Typedef Documentation

◆ reference_type

template<class T , unsigned int N>
using amrex::GpuArray< T, N >::reference_type = T&

◆ value_type

template<class T , unsigned int N>
using amrex::GpuArray< T, N >::value_type = T

Member Function Documentation

◆ begin() [1/2]

template<class T , unsigned int N>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T* amrex::GpuArray< T, N >::begin ( ) const
inlinenoexcept

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

◆ begin() [2/2]

template<class T , unsigned int N>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T* amrex::GpuArray< T, N >::begin ( )
inlinenoexcept

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

◆ data() [1/2]

template<class T , unsigned int N>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T* amrex::GpuArray< T, N >::data ( ) const
inlinenoexcept

Returns a const pointer to the underlying data of a GpuArray object.

◆ data() [2/2]

template<class T , unsigned int N>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T* amrex::GpuArray< T, N >::data ( )
inlinenoexcept

Returns a pointer to the underlying data of a GpuArray object.

◆ end() [1/2]

template<class T , unsigned int N>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T* amrex::GpuArray< T, N >::end ( ) const
inlinenoexcept

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

◆ end() [2/2]

template<class T , unsigned int N>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T* amrex::GpuArray< T, N >::end ( )
inlinenoexcept

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

◆ fill()

template<class T , unsigned int N>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void amrex::GpuArray< T, N >::fill ( const T &  value)
inlinenoexcept

Fills in all of the elements in the GpuArray object to the same value.

Parameters
valueThe fill value

◆ operator+=()

template<class T , unsigned int N>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuArray<T,N>& amrex::GpuArray< T, N >::operator+= ( GpuArray< T, N > const &  a)
inlinenoexcept

◆ operator[]() [1/2]

template<class T , unsigned int N>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T& amrex::GpuArray< T, N >::operator[] ( int  i) const
inlinenoexcept

GpuArray elements are indexed using square brackets, as with any other array.

◆ operator[]() [2/2]

template<class T , unsigned int N>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T& amrex::GpuArray< T, N >::operator[] ( int  i)
inlinenoexcept

GpuArray elements are indexed using square brackets, as with any other array.

◆ product()

template<class T , unsigned int N>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T amrex::GpuArray< T, N >::product ( ) const
inlinenoexcept

Returns the product of all elements in the GpuArray object.

◆ size()

template<class T , unsigned int N>
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int amrex::GpuArray< T, N >::size ( )
inlinestaticconstexprnoexcept

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

◆ sum()

template<class T , unsigned int N>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T amrex::GpuArray< T, N >::sum ( ) const
inlineconstexprnoexcept

Returns the sum of all elements in the GpuArray object.

Member Data Documentation

◆ arr

template<class T , unsigned int N>
T amrex::GpuArray< T, N >::arr[amrex::max(N, 1U)]

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