|
| __host__ __device__ const T * | begin () const noexcept |
| |
| __host__ __device__ const T * | end () const noexcept |
| |
| __host__ __device__ T * | begin () noexcept |
| |
| __host__ __device__ T * | end () noexcept |
| |
| template<Order Ord = ORDER, std::enable_if_t< Ord==Order::F, int > = 0> |
| __host__ __device__ const T & | operator() (int i, int j) const noexcept |
| |
| template<Order Ord = ORDER, std::enable_if_t< Ord==Order::F, int > = 0> |
| __host__ __device__ T & | operator() (int i, int j) noexcept |
| |
| template<Order Ord = ORDER, std::enable_if_t< Ord==Order::C, int > = 0> |
| __host__ __device__ const T & | operator() (int i, int j) const noexcept |
| |
| template<Order Ord = ORDER, std::enable_if_t< Ord==Order::C, int > = 0> |
| __host__ __device__ T & | operator() (int i, int j) noexcept |
| |
| __host__ __device__ constexpr T | sum () const noexcept |
| |
| __host__ __device__ constexpr T | sum (int axis, int loc) const noexcept |
| |
| __host__ __device__ constexpr T | product () const noexcept |
| |
| __host__ __device__ constexpr T | product (int axis, int loc) const noexcept |
| |
template<class T, int XLO, int XHI, int YLO, int YHI,
Order ORDER = Order::F>
struct amrex::Array2D< T, XLO, XHI, YLO, YHI, ORDER >
A GPU-compatible two-dimensional array.
- Template Parameters
-
| XLO | Index for lower bound in x dimension. Can be other than 0. |
| XHI | Index for upper bound in x dimension. |
| YLO | Index for lower bound in y dimension. Can be other than 0. |
| YHI | Index for upper bound in y dimension. |
| ORDER | Either Order::C (C/C++ row-major order) or Order::F (Fortran column-major order, which is the default if not given) |
template<class T , int XLO, int XHI, int YLO, int YHI,
Order ORDER = Order::F>
| __host__ __device__ constexpr T amrex::Array2D< T, XLO, XHI, YLO, YHI, ORDER >::product |
( |
int |
axis, |
|
|
int |
loc |
|
) |
| const |
|
inlineconstexprnoexcept |
When called with two arguments, performs a product reduction over the specified axis, for a particular location index loc.
- Parameters
-
| axis | The dimension to reduce (0 for x dimension, 1 for y dimension) |
| loc | The appropriate location index |
This can be used, for instance, to calculate the product over the x dimension of an Array2D object that was instantiated as
Definition AMReX_Array.H:341
One could instantiate an Array1D object to hold the results with,
Definition AMReX_Array.H:193
and then perform the product for each element of the resulting vector.
for (int j = 1; j <= N; ++j) {
}
__host__ __device__ constexpr T sum() const noexcept
Definition AMReX_Array.H:488
In this example, the axis is 0 and the location index is j.
template<class T , int XLO, int XHI, int YLO, int YHI,
Order ORDER = Order::F>
| __host__ __device__ constexpr T amrex::Array2D< T, XLO, XHI, YLO, YHI, ORDER >::sum |
( |
int |
axis, |
|
|
int |
loc |
|
) |
| const |
|
inlineconstexprnoexcept |
When called with two arguments, performs a sum reduction over the specified axis, for a particular location index loc.
- Parameters
-
| axis | The dimension to reduce (0 for x dimension, 1 for y dimension) |
| loc | The appropriate location index |
This can be used, for instance, to calculate the sum over the y dimension of an Array2D object that was instantiated as
One could instantiate an Array1D object to hold the results,
and then perform the summation for each element of the resulting vector.
for (int i = 1; i <= M; ++i) {
}
In this example, the axis is 1 and the location index is i.