|
| __host__ __device__ constexpr | ArrayND () noexcept |
| |
| template<class U = T, std::enable_if_t< std::is_const_v< U >, int > = 0> |
| __host__ __device__ constexpr | ArrayND (ArrayND< std::remove_const_t< T >, N, last_dim_component > const &rhs) noexcept |
| |
| template<bool C = last_dim_component, std::enable_if_t<!C, int > = 0> |
| __host__ __device__ | ArrayND (T *a_p, BoxND< N > const &box) noexcept |
| | Constructor using a BoxND.
|
| |
| template<int M, std::enable_if_t<((M+1==N)||(N==4 &&M==3)) &&last_dim_component, int > = 0> |
| __host__ __device__ | ArrayND (T *a_p, BoxND< M > const &box, int ncomp) noexcept |
| | Constructor using a BoxND.
|
| |
| template<bool C = last_dim_component, std::enable_if_t<!C, int > = 0> |
| __host__ __device__ constexpr | ArrayND (T *a_p, IntVectND< N > const &a_begin, IntVectND< N > const &a_end) noexcept |
| | IntVectND<N> constructor.
|
| |
| template<bool B = IsArray4_v, std::enable_if_t< B, int > = 0> |
| __host__ __device__ constexpr | ArrayND (T *a_p, Dim3 const &a_begin, Dim3 const &a_end, int a_ncomp) noexcept |
| | Constructor for N=4 using Dim3.
|
| |
| template<int M, std::enable_if_t<((M+1==N)||(N==4 &&M==3)) &&last_dim_component, int > = 0> |
| __host__ __device__ constexpr | ArrayND (T *a_p, IntVectND< M > const &a_begin, IntVectND< M > const &a_end, int ncomp) noexcept |
| | Reduced dimension constructor with component count.
|
| |
| template<class U , std::enable_if_t< std::is_same_v< std::remove_const_t< T >, std::remove_const_t< U > > &&(N >=2) &&last_dim_component, int > = 0> |
| __host__ __device__ constexpr | ArrayND (ArrayND< U, N, last_dim_component > const &rhs, int start_comp) noexcept |
| | Slicing constructor (Component subset).
|
| |
| template<class U , std::enable_if_t< std::is_same_v< std::remove_const_t< T >, std::remove_const_t< U > > &&(N >=2) &&last_dim_component, int > = 0> |
| __host__ __device__ constexpr | ArrayND (ArrayND< U, N, last_dim_component > const &rhs, int start_comp, int num_comp) noexcept |
| | Slicing constructor (Component subset with count).
|
| |
| __host__ __device__ constexpr | operator bool () const noexcept |
| | Check if the ArrayND pointer is valid.
|
| |
| __host__ __device__ constexpr bool | ok () const noexcept |
| | Check if the ArrayND pointer is valid and bounds are valid.
|
| |
| template<typename... idx, class U = T, std::enable_if_t<!std::is_void_v< U > &&!IsArray4_v &&detail::ArrayNDIndexCheck_impl_v< N, last_dim_component, idx... >, int > = 0> |
| __host__ __device__ U & | operator() (idx... i) const noexcept |
| | Multi-index operator() for accessing elements.
|
| |
| template<int M, class U = T, std::enable_if_t< !std::is_void_v< U > &&((M==N)||(!IsArray4_v &&last_dim_component &&(M+1==N))), int > = 0> |
| __host__ __device__ U & | operator() (IntVectND< M > const &iv) const noexcept |
| | Access element by IntVectND.
|
| |
| template<int M, class U = T, std::enable_if_t< !std::is_void_v< U > &&last_dim_component &&!IsArray4_v &&(M+1==N), int > = 0> |
| __host__ __device__ U & | operator() (IntVectND< M > const &iv, int n) const noexcept |
| | Access element by spatial IntVectND and component index.
|
| |
| template<typename... idx, class U = T, std::enable_if_t<!std::is_void_v< U > &&!IsArray4_v &&detail::ArrayNDIndexCheck_impl_v< N, last_dim_component, idx... >, int > = 0> |
| __host__ __device__ T * | ptr (idx... i) const noexcept |
| | Multi-index ptr() for accessing pointer to element.
|
| |
| template<int M, std::enable_if_t<(M==N)||(!IsArray4_v &&last_dim_component &&(M+1==N)), int > = 0> |
| __host__ __device__ T * | ptr (IntVectND< M > const &iv) const noexcept |
| | Access pointer by IntVectND.
|
| |
| template<int M, std::enable_if_t< last_dim_component &&!IsArray4_v &&(M+1==N), int > = 0> |
| __host__ __device__ T * | ptr (IntVectND< M > const &iv, int n) const noexcept |
| | Access pointer by spatial IntVectND and component index.
|
| |
| __host__ __device__ constexpr T * | dataPtr () const noexcept |
| | Get raw data pointer.
|
| |
| __host__ __device__ constexpr int | nComp () const noexcept |
| | Get number of components.
|
| |
| __host__ __device__ constexpr std::size_t | size () const noexcept |
| |
| template<int d, std::enable_if_t<(d< N) &&(d >=0), int > = 0> |
| __host__ __device__ constexpr Long | get_stride () const noexcept |
| |
| template<typename... idx, std::enable_if_t<!IsArray4_v &&detail::ArrayNDIndexCheck_impl_v< N, last_dim_component, idx... >, int > = 0> |
| __host__ __device__ constexpr bool | contains (idx... i) const noexcept |
| |
| template<int M, std::enable_if_t<(M==N)||(!IsArray4_v &&last_dim_component &&(M+1==N)), int > = 0> |
| __host__ __device__ constexpr bool | contains (IntVectND< M > const &iv) const noexcept |
| |
| template<int M, std::enable_if_t< last_dim_component &&!IsArray4_v &&(M+1==N), int > = 0> |
| __host__ __device__ constexpr bool | contains (IntVectND< M > const &iv, int n) const noexcept |
| |
| template<int M = N, bool B = IsArray4_v, std::enable_if_t< B, int > = 0> |
| __host__ __device__ CellData< T > | cellData (int i, int j, int k) const noexcept |
| |
| template<int M, std::enable_if_t<(M==N)||(last_dim_component &&(M+1==N||M==3)), int > = 0> |
| __host__ __device__ constexpr Long | get_offset (IntVectND< M > const &iv) const noexcept |
| |
| template<int M, std::enable_if_t< last_dim_component &&((M+1==N)||(N==4 &&M==3)), int > = 0> |
| __host__ __device__ constexpr Long | get_offset (IntVectND< M > const &iv, int n) const noexcept |
| |
| template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0> |
| __host__ __device__ U & | operator() (int i, int j, int k) const noexcept |
| |
| template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0> |
| __host__ __device__ U & | operator() (int i, int j, int k, int n) const noexcept |
| |
| template<int M, class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v &&(M==3||M==3), int > = 0> |
| __host__ __device__ U & | operator() (IntVectND< M > const &iv) const noexcept |
| |
| template<int M, class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v &&(M==3||M==3), int > = 0> |
| __host__ __device__ U & | operator() (IntVectND< M > const &iv, int n) const noexcept |
| |
| template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0> |
| __host__ __device__ U & | operator() (Dim3 const &cell) const noexcept |
| |
| template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0> |
| __host__ __device__ U & | operator() (Dim3 const &cell, int n) const noexcept |
| |
| template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0> |
| __host__ __device__ U * | ptr (int i, int j, int k) const noexcept |
| |
| template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0> |
| __host__ __device__ U * | ptr (int i, int j, int k, int n) const noexcept |
| |
| template<int M, class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v &&(M==3||M==3), int > = 0> |
| __host__ __device__ U * | ptr (IntVectND< M > const &iv) const noexcept |
| |
| template<int M, class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v &&(M==3||M==3), int > = 0> |
| __host__ __device__ U * | ptr (IntVectND< M > const &iv, int n) const noexcept |
| |
| template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0> |
| __host__ __device__ U * | ptr (Dim3 const &cell) const noexcept |
| |
| template<class U = T, std::enable_if_t<!std::is_void_v< U > &&IsArray4_v, int > = 0> |
| __host__ __device__ U * | ptr (Dim3 const &cell, int n) const noexcept |
| |
| template<bool B = IsArray4_v, std::enable_if_t< B, int > = 0> |
| __host__ __device__ bool | contains (int i, int j, int k) const noexcept |
| |
| template<int M, std::enable_if_t< IsArray4_v &&(M==3||M==3), int > = 0> |
| __host__ __device__ bool | contains (IntVectND< M > const &iv) const noexcept |
| |
| template<bool B = IsArray4_v, std::enable_if_t< B, int > = 0> |
| __host__ __device__ bool | contains (Dim3 const &cell) const noexcept |
| |
template<typename T,
int N, bool last_dim_component = false>
struct amrex::ArrayND< T, N, last_dim_component >
A multidimensional array accessor.
- Template Parameters
-
| T | The type of data (e.g., Real, int). |
| N | The dimension of the array (rank). |
| last_dim_component | If true, the last dimension is treated as components. |
ArrayND is a lightweight, non-owning wrapper around a pointer that provides multidimensional indexing into a contiguous memory block. It is trivially copyable and designed to be passed by value into GPU kernels. Note, ArrayND follows fortran-style column-major ordering.
It stores the pointer, stride information, and the bounds (begin and end) of the array.