Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_Array.H
Go to the documentation of this file.
1#ifndef AMREX_ARRAY_H_
2#define AMREX_ARRAY_H_
3#include <AMReX_Config.H>
4
5#include <AMReX.H>
7#include <AMReX_GpuControl.H>
8#include <AMReX_BLassert.H>
9#include <AMReX_SPACE.H>
10#include <AMReX_REAL.H>
11#include <AMReX_Algorithm.H>
12#include <AMReX_Dim3.H>
13#include <AMReX_Order.H>
14
15#include <array>
16#include <memory>
17#include <utility>
18#include <sstream>
19#include <type_traits>
20
21namespace amrex {
22
25 template <class T, std::size_t N>
26 using Array = std::array<T,N>;
27
30
31}
32
33namespace amrex {
39 template <class T, unsigned int N>
40 struct GpuArray
41 {
42 using value_type = T;
43 using reference_type = T&;
44
50 const T& operator [] (int i) const noexcept {
51#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
52 index_assert(i);
53#endif
54 return arr[i];
55 }
56
62 T& operator [] (int i) noexcept {
63#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
64 index_assert(i);
65#endif
66 return arr[i];
67 }
68
73 const T* data () const noexcept { return arr; }
74
79 T* data () noexcept { return arr; }
80
86 static constexpr unsigned int size () noexcept { return N; }
87
93 const T* begin () const noexcept { return arr; }
94
100 const T* end () const noexcept { return arr + N; }
101
107 T* begin () noexcept { return arr; }
108
114 T* end () noexcept { return arr + N; }
115
123 void fill ( const T& value ) noexcept
124 { for (unsigned int i = 0; i < N; ++i) { arr[i] = value; } }
125
130 constexpr T sum () const noexcept
131 {
132 T s = 0;
133 for (unsigned int i = 0; i < N; ++i) { s += arr[i]; }
134 return s;
135 }
136
141 T product () const noexcept
142 {
143 T p = 1;
144 for (unsigned int i = 0; i < N; ++i) { p *= arr[i]; }
145 return p;
146 }
147
150 {
151 for (unsigned int i = 0; i < N; ++i) {
152 arr[i] += a.arr[i];
153 }
154 return *this;
155 }
156
157#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
158#if defined(AMREX_USE_HIP)
160#else
162#endif
163 static void index_assert (int i)
164 {
165 if (i < 0 || static_cast<unsigned int>(i) >= N) {
167 AMREX_DEVICE_PRINTF(" (%d) is out of bound (0:%d)\n",
168 i, N-1);
169 amrex::Abort();
170 ))
172 std::stringstream ss;
173 ss << " (" << i << ") is out of bound (0:" << N-1 <<")";
174 amrex::Abort(ss.str());
175 ))
176 }
177 }
178#endif
179 T arr[amrex::max(N,1U)];
180 };
181}
182
183namespace amrex {
184
198 template <class T, int XLO, int XHI>
199 struct Array1D
200 {
206 static constexpr unsigned int size () noexcept { return (XHI-XLO+1); }
207
213 static constexpr int lo () noexcept { return XLO; }
214
219 static constexpr int hi () noexcept { return XHI; }
220
226 static constexpr unsigned int len () noexcept { return (XHI-XLO+1); }
227
233 const T* begin () const noexcept { return arr; }
234
240 const T* end () const noexcept { return arr + XHI-XLO+1; }
241
247 T* begin () noexcept { return arr; }
248
254 T* end () noexcept { return arr + XHI-XLO+1; }
255
261 const T& operator() (int i) const noexcept {
262#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
263 index_assert(i);
264#endif
265 return arr[i-XLO];
266 }
267
273 T& operator() (int i) noexcept {
274#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
275 index_assert(i);
276#endif
277 return arr[i-XLO];
278 }
279
284 constexpr T sum () const noexcept
285 {
286 T s = 0;
287 for (int i = XLO; i <= XHI; ++i) { s += arr[i-XLO]; }
288 return s;
289 }
290
295 constexpr T product() const noexcept
296 {
297 T p = 1;
298 for (int i = 0; i < (XHI-XLO+1); ++i) {
299 p *= arr[i];
300 }
301 return p;
302 }
303#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
304#if defined(AMREX_USE_HIP)
306#else
308#endif
309 static void index_assert (int i)
310 {
311 if (i<XLO || i>XHI) {
313 AMREX_DEVICE_PRINTF(" (%d) is out of bound (%d:%d)\n",
314 i, XLO, XHI);
315 amrex::Abort();
316 ))
318 std::stringstream ss;
319 ss << " (" << i << ") is out of bound ("
320 << XLO << ":" << XHI << ")";
321 amrex::Abort(ss.str());
322 ))
323 }
324 }
325#endif
326
331 T arr[(XHI-XLO+1)];
332 };
333
345 template <class T, int XLO, int XHI, int YLO, int YHI,
346 Order ORDER = Order::F>
347 struct Array2D
348 {
354 static constexpr unsigned int size() noexcept { return (XHI-XLO+1)*(YHI-YLO+1); }
355
362 static constexpr int xlo () noexcept { return XLO; }
363
369 static constexpr int xhi () noexcept { return XHI; }
370
371
377 static constexpr unsigned int xlen () noexcept { return (XHI-XLO+1); }
378
385 static constexpr int ylo () noexcept { return YLO; }
386
392 static constexpr int yhi () noexcept { return YHI; }
393
394
400 static constexpr unsigned int ylen () noexcept { return (YHI-YLO+1); }
401
407 const T* begin () const noexcept { return arr; }
408
414 const T* end () const noexcept { return arr + (XHI-XLO+1)*(YHI-YLO+1); }
415
421 T* begin () noexcept { return arr; }
422
428 T* end () noexcept { return arr + (XHI-XLO+1)*(YHI-YLO+1); }
429
436 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::F,int> = 0>
438 const T& operator() (int i, int j) const noexcept {
439#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
440 index_assert(i, j);
441#endif
442 return arr[i+j*(XHI-XLO+1)-(YLO*(XHI-XLO+1)+XLO)];
443 }
444
451 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::F,int> = 0>
453 T& operator() (int i, int j) noexcept {
454#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
455 index_assert(i, j);
456#endif
457 return arr[i+j*(XHI-XLO+1)-(YLO*(XHI-XLO+1)+XLO)];
458 }
459
466 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::C,int> = 0>
468 const T& operator() (int i, int j) const noexcept {
469#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
470 index_assert(i, j);
471#endif
472 return arr[j+i*(YHI-YLO+1)-(XLO*(YHI-YLO+1)+YLO)];
473 }
474
481 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::C,int> = 0>
483 T& operator() (int i, int j) noexcept {
484#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
485 index_assert(i, j);
486#endif
487 return arr[j+i*(YHI-YLO+1)-(XLO*(YHI-YLO+1)+YLO)];
488 }
489
495 constexpr T sum () const noexcept
496 {
497 T s = 0;
498 for (int i = 0; i < (XHI-XLO+1)*(YHI-YLO+1); ++i) {
499 s += arr[i];
500 }
501 return s;
502 }
503
533 constexpr T sum (int axis, int loc) const noexcept
534 {
535 T s = 0;
536 if (axis == 0) {
537 int j = loc;
538 for (int i = XLO; i <= XHI; ++i) {
539 s += this->operator()(i,j);
540 }
541 } else if (axis == 1) {
542 int i = loc;
543 for (int j = YLO; j <= YHI; ++j) {
544 s += this->operator()(i,j);
545 }
546 }
547 return s;
548 }
549
555 constexpr T product () const noexcept
556 {
557 T p = 1;
558 for (int i = 0; i < (XHI-XLO+1)*(YHI-YLO+1); ++i) {
559 p *= arr[i];
560 }
561 return p;
562 }
563
594 constexpr T product (int axis, int loc) const noexcept
595 {
596 T p = 1;
597 if (axis == 0) {
598 int j = loc;
599 for (int i = XLO; i <= XHI; ++i) {
600 p *= this->operator()(i,j);
601 }
602 } else if (axis == 1) {
603 int i = loc;
604 for (int j = YLO; j <= YHI; ++j) {
605 p *= this->operator()(i,j);
606 }
607 }
608 return p;
609 }
610#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
611#if defined(AMREX_USE_HIP)
613#else
615#endif
616 static void index_assert (int i, int j)
617 {
618 if (i<XLO || i>XHI || j<YLO || j>YHI) {
620 AMREX_DEVICE_PRINTF(" (%d,%d) is out of bound (%d:%d,%d:%d)\n",
621 i, j, XLO, XHI, YLO, YHI);
622 amrex::Abort();
623 ))
625 std::stringstream ss;
626 ss << " (" << i << "," << j
627 << ") is out of bound ("
628 << XLO << ":" << XHI << ","
629 << YLO << ":" << YHI << ")";
630 amrex::Abort(ss.str());
631 ))
632 }
633 }
634#endif
635 T arr[(XHI-XLO+1)*(YHI-YLO+1)];
636 };
637
638
652 template <class T, int XLO, int XHI, int YLO, int YHI, int ZLO, int ZHI,
653 Order ORDER=Order::F>
654 struct Array3D
655 {
661 static constexpr unsigned int size () noexcept { return (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); }
662
669 static constexpr int xlo () noexcept { return XLO; }
670
676 static constexpr int xhi () noexcept { return XHI; }
677
683 static constexpr unsigned int xlen () noexcept { return (XHI-XLO+1); }
684
691 static constexpr int ylo () noexcept { return YLO; }
692
698 static constexpr int yhi () noexcept { return YHI; }
699
700
706 static constexpr unsigned int ylen () noexcept { return (YHI-YLO+1); }
707
714 static constexpr int zlo () noexcept { return ZLO; }
715
721 static constexpr int zhi () noexcept { return ZHI; }
722
728 static constexpr unsigned int zlen () noexcept { return (ZHI-ZLO+1); }
729
735 const T* begin () const noexcept { return arr; }
736
742 const T* end () const noexcept { return arr + (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); }
743
749 T* begin () noexcept { return arr; }
750
756 T* end () noexcept { return arr + (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); }
757
764 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::F,int> = 0>
766 const T& operator() (int i, int j, int k) const noexcept {
767#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
768 index_assert(i, j, k);
769#endif
770 return arr[i+j*(XHI-XLO+1)+k*((XHI-XLO+1)*(YHI-YLO+1))
771 -(ZLO*((XHI-XLO+1)*(YHI-YLO+1))+YLO*(XHI-XLO+1)+XLO)];
772 }
773
780 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::F,int> = 0>
782 T& operator() (int i, int j, int k) noexcept {
783#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
784 index_assert(i, j, k);
785#endif
786 return arr[i+j*(XHI-XLO+1)+k*((XHI-XLO+1)*(YHI-YLO+1))
787 -(ZLO*((XHI-XLO+1)*(YHI-YLO+1))+YLO*(XHI-XLO+1)+XLO)];
788 }
789
796 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::C,int> = 0>
798 const T& operator() (int i, int j, int k) const noexcept {
799#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
800 index_assert(i, j, k);
801#endif
802 return arr[k+j*(ZHI-ZLO+1)+i*((ZHI-ZLO+1)*(YHI-YLO+1))
803 -(XLO*((ZHI-ZLO+1)*(YHI-YLO+1))+YLO*(ZHI-ZLO+1)+ZLO)];
804 }
805
812 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::C,int> = 0>
814 T& operator() (int i, int j, int k) noexcept {
815#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
816 index_assert(i, j, k);
817#endif
818 return arr[k+j*(ZHI-ZLO+1)+i*((ZHI-ZLO+1)*(YHI-YLO+1))
819 -(XLO*((ZHI-ZLO+1)*(YHI-YLO+1))+YLO*(ZHI-ZLO+1)+ZLO)];
820 }
821
827 constexpr T sum () const noexcept
828 {
829 T s = 0;
830 for (int i = 0; i < (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); ++i) {
831 s += arr[i];
832 }
833 return s;
834 }
835
871 constexpr T sum (int axis, int loc0, int loc1) const noexcept
872 {
873 T s = 0;
874 if (axis == 0) {
875 int j = loc0;
876 int k = loc1;
877 for (int i = XLO; i <= XHI; ++i) {
878 s += this->operator()(i,j,k);
879 }
880 } else if (axis == 1) {
881 int i = loc0;
882 int k = loc1;
883 for (int j = YLO; j <= YHI; ++j) {
884 s += this->operator()(i,j,k);
885 }
886 } else if (axis == 2) {
887 int i = loc0;
888 int j = loc1;
889 for (int k = ZLO; k <= ZHI; ++k) {
890 s += this->operator()(i,j,k);
891 }
892 }
893 return s;
894 }
895
901 constexpr T product () const noexcept
902 {
903 T p = 1;
904 for (int i = 0; i < (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); ++i) {
905 p *= arr[i];
906 }
907 return p;
908 }
909
910
946 constexpr T product (const int axis, const int loc0, const int loc1) const noexcept
947 {
948 T p = 1;
949 if (axis == 0) {
950 int j = loc0;
951 int k = loc1;
952 for (int i = XLO; i <= XHI; ++i) {
953 p *= this->operator()(i,j,k);
954 }
955 } else if (axis == 1) {
956 int i = loc0;
957 int k = loc1;
958 for (int j = YLO; j <= YHI; ++j) {
959 p *= this->operator()(i,j,k);
960 }
961 } else if (axis == 2) {
962 int i = loc0;
963 int j = loc1;
964 for (int k = ZLO; k <= ZHI; ++k) {
965 p *= this->operator()(i,j,k);
966 }
967 }
968 return p;
969 }
970
971#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
972#if defined(AMREX_USE_HIP)
974#else
976#endif
977 static void index_assert (int i, int j, int k)
978 {
979 if (i<XLO || i>XHI || j<YLO || j>YHI || k<ZLO || k>ZHI) {
981 AMREX_DEVICE_PRINTF(" (%d,%d,%d) is out of bound (%d:%d,%d:%d,%d:%d)\n",
982 i, j, k, XLO, XHI, YLO, YHI, ZLO, ZHI);
983 amrex::Abort();
984 ))
986 std::stringstream ss;
987 ss << " (" << i << "," << j << "," << k
988 << ") is out of bound ("
989 << XLO << ":" << XHI << ","
990 << YLO << ":" << YHI << ","
991 << ZLO << ":" << ZHI << ")";
992 amrex::Abort(ss.str());
993 ))
994 }
995 }
996#endif
997
998 T arr[(XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1)];
999 };
1000}
1001
1002namespace amrex
1003{
1004 template <class T, typename = typename T::FABType>
1005 std::array<T*,AMREX_SPACEDIM> GetArrOfPtrs (std::array<T,AMREX_SPACEDIM>& a) noexcept
1006 {
1007 return {{AMREX_D_DECL(a.data(), a.data()+1, a.data()+2)}};
1008 }
1009
1010 template <class T>
1011 std::array<T*,AMREX_SPACEDIM> GetArrOfPtrs (const std::array<std::unique_ptr<T>,AMREX_SPACEDIM>& a) noexcept
1012 {
1013 return {{AMREX_D_DECL(a[0].get(), a[1].get(), a[2].get())}};
1014 }
1015
1016 template <class T>
1017 std::array<T const*,AMREX_SPACEDIM> GetArrOfConstPtrs (const std::array<T,AMREX_SPACEDIM>& a) noexcept
1018 {
1019 return {{AMREX_D_DECL(a.data(), a.data()+1, a.data()+2)}};
1020 }
1021
1022 template <class T>
1023 std::array<T const*,AMREX_SPACEDIM> GetArrOfConstPtrs (const std::array<T*,AMREX_SPACEDIM>& a) noexcept
1024 {
1025 return {{AMREX_D_DECL(a[0], a[1], a[2])}};
1026 }
1027
1028 template <class T>
1029 std::array<T const*,AMREX_SPACEDIM> GetArrOfConstPtrs (const std::array<std::unique_ptr<T>,AMREX_SPACEDIM>& a) noexcept
1030 {
1031 return {{AMREX_D_DECL(a[0].get(), a[1].get(), a[2].get())}};
1032 }
1033
1034}
1035
1036namespace amrex
1037{
1038 inline XDim3 makeXDim3 (const Array<Real,AMREX_SPACEDIM>& a) noexcept
1039 {
1040#if (AMREX_SPACEDIM == 1)
1041 return XDim3{a[0], 0., 0.};
1042#elif (AMREX_SPACEDIM == 2)
1043 return XDim3{a[0], a[1], 0.};
1044#else
1045 return XDim3{a[0], a[1], a[2]};
1046#endif
1047 }
1048}
1049
1050#endif
#define AMREX_NO_INLINE
Definition AMReX_Extension.H:136
#define AMREX_FORCE_INLINE
Definition AMReX_Extension.H:119
#define AMREX_DEVICE_PRINTF(...)
Definition AMReX_GpuPrint.H:21
#define AMREX_IF_ON_DEVICE(CODE)
Definition AMReX_GpuQualifiers.H:56
#define AMREX_IF_ON_HOST(CODE)
Definition AMReX_GpuQualifiers.H:58
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
#define AMREX_D_DECL(a, b, c)
Definition AMReX_SPACE.H:171
std::array< T, N > Array
Definition AMReX_Array.H:26
Definition AMReX_Amr.cpp:49
Array< int, 3 > IntArray
Definition AMReX_Array.H:29
std::array< T const *, 3 > GetArrOfConstPtrs(const std::array< T, 3 > &a) noexcept
Definition AMReX_Array.H:1017
Order
Definition AMReX_Order.H:7
XDim3 makeXDim3(const Array< Real, 3 > &a) noexcept
Definition AMReX_Array.H:1038
std::array< T *, 3 > GetArrOfPtrs(std::array< T, 3 > &a) noexcept
Definition AMReX_Array.H:1005
__host__ __device__ constexpr const T & max(const T &a, const T &b) noexcept
Definition AMReX_Algorithm.H:44
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition AMReX.cpp:230
Array< Real, 3 > RealArray
Definition AMReX_Array.H:28
__host__ __device__ constexpr int get(IntVectND< dim > const &iv) noexcept
Get I'th element of IntVectND<dim>
Definition AMReX_IntVect.H:1230
Definition AMReX_Array.H:200
__host__ static __device__ constexpr unsigned int size() noexcept
Definition AMReX_Array.H:206
__host__ static __device__ constexpr int hi() noexcept
Definition AMReX_Array.H:219
__host__ __device__ const T * end() const noexcept
Definition AMReX_Array.H:240
__host__ __device__ const T * begin() const noexcept
Definition AMReX_Array.H:233
__host__ __device__ T * end() noexcept
Definition AMReX_Array.H:254
__host__ static __device__ constexpr unsigned int len() noexcept
Definition AMReX_Array.H:226
__host__ static __device__ constexpr int lo() noexcept
Definition AMReX_Array.H:213
__host__ __device__ constexpr T sum() const noexcept
Definition AMReX_Array.H:284
__host__ __device__ T * begin() noexcept
Definition AMReX_Array.H:247
__host__ __device__ constexpr T product() const noexcept
Definition AMReX_Array.H:295
Definition AMReX_Array.H:348
__host__ static __device__ constexpr unsigned int ylen() noexcept
Definition AMReX_Array.H:400
__host__ static __device__ constexpr int yhi() noexcept
Definition AMReX_Array.H:392
__host__ __device__ T * end() noexcept
Definition AMReX_Array.H:428
__host__ __device__ constexpr T sum(int axis, int loc) const noexcept
Definition AMReX_Array.H:533
__host__ static __device__ constexpr unsigned int xlen() noexcept
Definition AMReX_Array.H:377
__host__ static __device__ constexpr int xlo() noexcept
Definition AMReX_Array.H:362
__host__ __device__ const T * begin() const noexcept
Definition AMReX_Array.H:407
__host__ __device__ constexpr T sum() const noexcept
Definition AMReX_Array.H:495
__host__ __device__ T * begin() noexcept
Definition AMReX_Array.H:421
__host__ static __device__ constexpr int ylo() noexcept
Definition AMReX_Array.H:385
__host__ __device__ constexpr T product(int axis, int loc) const noexcept
Definition AMReX_Array.H:594
__host__ __device__ constexpr T product() const noexcept
Definition AMReX_Array.H:555
__host__ __device__ const T * end() const noexcept
Definition AMReX_Array.H:414
__host__ static __device__ constexpr int xhi() noexcept
Definition AMReX_Array.H:369
__host__ static __device__ constexpr unsigned int size() noexcept
Definition AMReX_Array.H:354
Definition AMReX_Array.H:655
__host__ static __device__ constexpr int xlo() noexcept
Definition AMReX_Array.H:669
__host__ static __device__ constexpr int zhi() noexcept
Definition AMReX_Array.H:721
__host__ __device__ constexpr T product(const int axis, const int loc0, const int loc1) const noexcept
Definition AMReX_Array.H:946
__host__ static __device__ constexpr unsigned int xlen() noexcept
Definition AMReX_Array.H:683
__host__ __device__ constexpr T sum() const noexcept
Definition AMReX_Array.H:827
__host__ __device__ const T * begin() const noexcept
Definition AMReX_Array.H:735
__host__ __device__ T * end() noexcept
Definition AMReX_Array.H:756
__host__ __device__ T * begin() noexcept
Definition AMReX_Array.H:749
__host__ __device__ constexpr T product() const noexcept
Definition AMReX_Array.H:901
__host__ __device__ constexpr T sum(int axis, int loc0, int loc1) const noexcept
Definition AMReX_Array.H:871
__host__ static __device__ constexpr unsigned int size() noexcept
Definition AMReX_Array.H:661
__host__ static __device__ constexpr int xhi() noexcept
Definition AMReX_Array.H:676
__host__ static __device__ constexpr unsigned int ylen() noexcept
Definition AMReX_Array.H:706
__host__ static __device__ constexpr int zlo() noexcept
Definition AMReX_Array.H:714
__host__ __device__ const T * end() const noexcept
Definition AMReX_Array.H:742
__host__ static __device__ constexpr int yhi() noexcept
Definition AMReX_Array.H:698
__host__ static __device__ constexpr int ylo() noexcept
Definition AMReX_Array.H:691
__host__ static __device__ constexpr unsigned int zlen() noexcept
Definition AMReX_Array.H:728
Fixed-size array that can be used on GPU.
Definition AMReX_Array.H:41
T & reference_type
Definition AMReX_Array.H:43
__host__ __device__ constexpr T sum() const noexcept
Definition AMReX_Array.H:130
T value_type
Definition AMReX_Array.H:42
__host__ __device__ const T * end() const noexcept
Definition AMReX_Array.H:100
__host__ __device__ T * end() noexcept
Definition AMReX_Array.H:114
__host__ __device__ const T * data() const noexcept
Definition AMReX_Array.H:73
T arr[amrex::max(N, 1U)]
Definition AMReX_Array.H:179
__host__ __device__ void fill(const T &value) noexcept
Definition AMReX_Array.H:123
__host__ __device__ T * begin() noexcept
Definition AMReX_Array.H:107
__host__ __device__ T product() const noexcept
Definition AMReX_Array.H:141
__host__ __device__ T * data() noexcept
Definition AMReX_Array.H:79
__host__ __device__ const T * begin() const noexcept
Definition AMReX_Array.H:93
__host__ static __device__ constexpr unsigned int size() noexcept
Definition AMReX_Array.H:86
__host__ __device__ const T & operator[](int i) const noexcept
Definition AMReX_Array.H:50
__host__ __device__ GpuArray< T, N > & operator+=(GpuArray< T, N > const &a) noexcept
Definition AMReX_Array.H:149
Definition AMReX_Dim3.H:13