Block-Structured AMR Software Framework
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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_SmallMatrix.H>
14
15#include <array>
16#include <memory>
17#include <utility>
18#include <sstream>
19#include <type_traits>
20
21namespace amrex {
22
23 template <class T, std::size_t N>
24 using Array = std::array<T,N>;
25
28
29}
30
31namespace amrex {
32 template <class T, unsigned int N>
33 struct GpuArray
34 {
35 using value_type = T;
36 using reference_type = T&;
37
43 const T& operator [] (int i) const noexcept {
44#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
45 index_assert(i);
46#endif
47 return arr[i];
48 }
49
55 T& operator [] (int i) noexcept {
56#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
57 index_assert(i);
58#endif
59 return arr[i];
60 }
61
66 const T* data () const noexcept { return arr; }
67
72 T* data () noexcept { return arr; }
73
79 static constexpr unsigned int size () noexcept { return N; }
80
86 const T* begin () const noexcept { return arr; }
87
93 const T* end () const noexcept { return arr + N; }
94
100 T* begin () noexcept { return arr; }
101
107 T* end () noexcept { return arr + N; }
108
116 void fill ( const T& value ) noexcept
117 { for (unsigned int i = 0; i < N; ++i) { arr[i] = value; } }
118
123 constexpr T sum () const noexcept
124 {
125 T s = 0;
126 for (unsigned int i = 0; i < N; ++i) { s += arr[i]; }
127 return s;
128 }
129
134 T product () const noexcept
135 {
136 T p = 1;
137 for (unsigned int i = 0; i < N; ++i) { p *= arr[i]; }
138 return p;
139 }
140
143 {
144 for (unsigned int i = 0; i < N; ++i) {
145 arr[i] += a.arr[i];
146 }
147 return *this;
148 }
149
150#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
152 static void index_assert (int i)
153 {
154 if (i < 0 || static_cast<unsigned int>(i) >= N) {
156 AMREX_DEVICE_PRINTF(" (%d) is out of bound (0:%d)\n",
157 i, N-1);
158 amrex::Abort();
159 ))
161 std::stringstream ss;
162 ss << " (" << i << ") is out of bound (0:" << N-1 <<")";
163 amrex::Abort(ss.str());
164 ))
165 }
166 }
167#endif
168 T arr[amrex::max(N,1U)];
169 };
170}
171
172namespace amrex {
173
187 template <class T, int XLO, int XHI>
188 struct Array1D
189 {
195 static constexpr unsigned int size () noexcept { return (XHI-XLO+1); }
196
202 static constexpr int lo () noexcept { return XLO; }
203
208 static constexpr int hi () noexcept { return XHI; }
209
215 static constexpr unsigned int len () noexcept { return (XHI-XLO+1); }
216
222 const T* begin () const noexcept { return arr; }
223
229 const T* end () const noexcept { return arr + XHI-XLO+1; }
230
236 T* begin () noexcept { return arr; }
237
243 T* end () noexcept { return arr + XHI-XLO+1; }
244
250 const T& operator() (int i) const noexcept {
251#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
252 index_assert(i);
253#endif
254 return arr[i-XLO];
255 }
256
262 T& operator() (int i) noexcept {
263#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
264 index_assert(i);
265#endif
266 return arr[i-XLO];
267 }
268
273 constexpr T sum () const noexcept
274 {
275 T s = 0;
276 for (int i = XLO; i <= XHI; ++i) { s += arr[i-XLO]; }
277 return s;
278 }
279
284 constexpr T product() const noexcept
285 {
286 T p = 1;
287 for (int i = 0; i < (XHI-XLO+1); ++i) {
288 p *= arr[i];
289 }
290 return p;
291 }
292#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
294 static void index_assert (int i)
295 {
296 if (i<XLO || i>XHI) {
298 AMREX_DEVICE_PRINTF(" (%d) is out of bound (%d:%d)\n",
299 i, XLO, XHI);
300 amrex::Abort();
301 ))
303 std::stringstream ss;
304 ss << " (" << i << ") is out of bound ("
305 << XLO << ":" << XHI << ")";
306 amrex::Abort(ss.str());
307 ))
308 }
309 }
310#endif
311
316 T arr[(XHI-XLO+1)];
317 };
318
330 template <class T, int XLO, int XHI, int YLO, int YHI,
331 Order ORDER = Order::F>
332 struct Array2D
333 {
339 static constexpr unsigned int size() noexcept { return (XHI-XLO+1)*(YHI-YLO+1); }
340
347 static constexpr int xlo () noexcept { return XLO; }
348
354 static constexpr int xhi () noexcept { return XHI; }
355
356
362 static constexpr unsigned int xlen () noexcept { return (XHI-XLO+1); }
363
370 static constexpr int ylo () noexcept { return YLO; }
371
377 static constexpr int yhi () noexcept { return YHI; }
378
379
385 static constexpr unsigned int ylen () noexcept { return (YHI-YLO+1); }
386
392 const T* begin () const noexcept { return arr; }
393
399 const T* end () const noexcept { return arr + (XHI-XLO+1)*(YHI-YLO+1); }
400
406 T* begin () noexcept { return arr; }
407
413 T* end () noexcept { return arr + (XHI-XLO+1)*(YHI-YLO+1); }
414
421 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::F,int> = 0>
423 const T& operator() (int i, int j) const noexcept {
424#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
425 index_assert(i, j);
426#endif
427 return arr[i+j*(XHI-XLO+1)-(YLO*(XHI-XLO+1)+XLO)];
428 }
429
436 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::F,int> = 0>
438 T& operator() (int i, int j) 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::C,int> = 0>
453 const T& operator() (int i, int j) const noexcept {
454#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
455 index_assert(i, j);
456#endif
457 return arr[j+i*(YHI-YLO+1)-(XLO*(YHI-YLO+1)+YLO)];
458 }
459
466 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::C,int> = 0>
468 T& operator() (int i, int j) 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
480 constexpr T sum () const noexcept
481 {
482 T s = 0;
483 for (int i = 0; i < (XHI-XLO+1)*(YHI-YLO+1); ++i) {
484 s += arr[i];
485 }
486 return s;
487 }
488
514 constexpr T sum (int axis, int loc) const noexcept
515 {
516 T s = 0;
517 if (axis == 0) {
518 int j = loc;
519 for (int i = XLO; i <= XHI; ++i) {
520 s += this->operator()(i,j);
521 }
522 } else if (axis == 1) {
523 int i = loc;
524 for (int j = YLO; j <= YHI; ++j) {
525 s += this->operator()(i,j);
526 }
527 }
528 return s;
529 }
530
536 constexpr T product () const noexcept
537 {
538 T p = 1;
539 for (int i = 0; i < (XHI-XLO+1)*(YHI-YLO+1); ++i) {
540 p *= arr[i];
541 }
542 return p;
543 }
544
571 constexpr T product (int axis, int loc) const noexcept
572 {
573 T p = 1;
574 if (axis == 0) {
575 int j = loc;
576 for (int i = XLO; i <= XHI; ++i) {
577 p *= this->operator()(i,j);
578 }
579 } else if (axis == 1) {
580 int i = loc;
581 for (int j = YLO; j <= YHI; ++j) {
582 p *= this->operator()(i,j);
583 }
584 }
585 return p;
586 }
587#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
589 static void index_assert (int i, int j)
590 {
591 if (i<XLO || i>XHI || j<YLO || j>YHI) {
593 AMREX_DEVICE_PRINTF(" (%d,%d) is out of bound (%d:%d,%d:%d)\n",
594 i, j, XLO, XHI, YLO, YHI);
595 amrex::Abort();
596 ))
598 std::stringstream ss;
599 ss << " (" << i << "," << j
600 << ") is out of bound ("
601 << XLO << ":" << XHI << ","
602 << YLO << ":" << YHI << ")";
603 amrex::Abort(ss.str());
604 ))
605 }
606 }
607#endif
608 T arr[(XHI-XLO+1)*(YHI-YLO+1)];
609 };
610
611
625 template <class T, int XLO, int XHI, int YLO, int YHI, int ZLO, int ZHI,
626 Order ORDER=Order::F>
627 struct Array3D
628 {
634 static constexpr unsigned int size () noexcept { return (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); }
635
642 static constexpr int xlo () noexcept { return XLO; }
643
649 static constexpr int xhi () noexcept { return XHI; }
650
656 static constexpr unsigned int xlen () noexcept { return (XHI-XLO+1); }
657
664 static constexpr int ylo () noexcept { return YLO; }
665
671 static constexpr int yhi () noexcept { return YHI; }
672
673
679 static constexpr unsigned int ylen () noexcept { return (YHI-YLO+1); }
680
687 static constexpr int zlo () noexcept { return ZLO; }
688
694 static constexpr int zhi () noexcept { return ZHI; }
695
701 static constexpr unsigned int zlen () noexcept { return (ZHI-ZLO+1); }
702
708 const T* begin () const noexcept { return arr; }
709
715 const T* end () const noexcept { return arr + (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); }
716
722 T* begin () noexcept { return arr; }
723
729 T* end () noexcept { return arr + (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); }
730
737 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::F,int> = 0>
739 const T& operator() (int i, int j, int k) const noexcept {
740#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
741 index_assert(i, j, k);
742#endif
743 return arr[i+j*(XHI-XLO+1)+k*((XHI-XLO+1)*(YHI-YLO+1))
744 -(ZLO*((XHI-XLO+1)*(YHI-YLO+1))+YLO*(XHI-XLO+1)+XLO)];
745 }
746
753 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::F,int> = 0>
755 T& operator() (int i, int j, int k) noexcept {
756#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
757 index_assert(i, j, k);
758#endif
759 return arr[i+j*(XHI-XLO+1)+k*((XHI-XLO+1)*(YHI-YLO+1))
760 -(ZLO*((XHI-XLO+1)*(YHI-YLO+1))+YLO*(XHI-XLO+1)+XLO)];
761 }
762
769 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::C,int> = 0>
771 const T& operator() (int i, int j, int k) const noexcept {
772#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
773 index_assert(i, j, k);
774#endif
775 return arr[k+j*(ZHI-ZLO+1)+i*((ZHI-ZLO+1)*(YHI-YLO+1))
776 -(XLO*((ZHI-ZLO+1)*(YHI-YLO+1))+YLO*(ZHI-ZLO+1)+ZLO)];
777 }
778
785 template <Order Ord=ORDER, std::enable_if_t<Ord==Order::C,int> = 0>
787 T& operator() (int i, int j, int k) noexcept {
788#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
789 index_assert(i, j, k);
790#endif
791 return arr[k+j*(ZHI-ZLO+1)+i*((ZHI-ZLO+1)*(YHI-YLO+1))
792 -(XLO*((ZHI-ZLO+1)*(YHI-YLO+1))+YLO*(ZHI-ZLO+1)+ZLO)];
793 }
794
800 constexpr T sum () const noexcept
801 {
802 T s = 0;
803 for (int i = 0; i < (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); ++i) {
804 s += arr[i];
805 }
806 return s;
807 }
808
840 constexpr T sum (int axis, int loc0, int loc1) const noexcept
841 {
842 T s = 0;
843 if (axis == 0) {
844 int j = loc0;
845 int k = loc1;
846 for (int i = XLO; i <= XHI; ++i) {
847 s += this->operator()(i,j,k);
848 }
849 } else if (axis == 1) {
850 int i = loc0;
851 int k = loc1;
852 for (int j = YLO; j <= YHI; ++j) {
853 s += this->operator()(i,j,k);
854 }
855 } else if (axis == 2) {
856 int i = loc0;
857 int j = loc1;
858 for (int k = ZLO; k <= ZHI; ++k) {
859 s += this->operator()(i,j,k);
860 }
861 }
862 return s;
863 }
864
870 constexpr T product () const noexcept
871 {
872 T p = 1;
873 for (int i = 0; i < (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); ++i) {
874 p *= arr[i];
875 }
876 return p;
877 }
878
879
911 constexpr T product (const int axis, const int loc0, const int loc1) const noexcept
912 {
913 T p = 1;
914 if (axis == 0) {
915 int j = loc0;
916 int k = loc1;
917 for (int i = XLO; i <= XHI; ++i) {
918 p *= this->operator()(i,j,k);
919 }
920 } else if (axis == 1) {
921 int i = loc0;
922 int k = loc1;
923 for (int j = YLO; j <= YHI; ++j) {
924 p *= this->operator()(i,j,k);
925 }
926 } else if (axis == 2) {
927 int i = loc0;
928 int j = loc1;
929 for (int k = ZLO; k <= ZHI; ++k) {
930 p *= this->operator()(i,j,k);
931 }
932 }
933 return p;
934 }
935
936#if defined(AMREX_DEBUG) || defined(AMREX_BOUND_CHECK)
938 static void index_assert (int i, int j, int k)
939 {
940 if (i<XLO || i>XHI || j<YLO || j>YHI || k<ZLO || k>ZHI) {
942 AMREX_DEVICE_PRINTF(" (%d,%d,%d) is out of bound (%d:%d,%d:%d,%d:%d)\n",
943 i, j, k, XLO, XHI, YLO, YHI, ZLO, ZHI);
944 amrex::Abort();
945 ))
947 std::stringstream ss;
948 ss << " (" << i << "," << j << "," << k
949 << ") is out of bound ("
950 << XLO << ":" << XHI << ","
951 << YLO << ":" << YHI << ","
952 << ZLO << ":" << ZHI << ")";
953 amrex::Abort(ss.str());
954 ))
955 }
956 }
957#endif
958
959 T arr[(XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1)];
960 };
961}
962
963namespace amrex
964{
965 template <class T, typename = typename T::FABType>
966 std::array<T*,AMREX_SPACEDIM> GetArrOfPtrs (std::array<T,AMREX_SPACEDIM>& a) noexcept
967 {
968 return {{AMREX_D_DECL(a.data(), a.data()+1, a.data()+2)}};
969 }
970
971 template <class T>
972 std::array<T*,AMREX_SPACEDIM> GetArrOfPtrs (const std::array<std::unique_ptr<T>,AMREX_SPACEDIM>& a) noexcept
973 {
974 return {{AMREX_D_DECL(a[0].get(), a[1].get(), a[2].get())}};
975 }
976
977 template <class T>
978 std::array<T const*,AMREX_SPACEDIM> GetArrOfConstPtrs (const std::array<T,AMREX_SPACEDIM>& a) noexcept
979 {
980 return {{AMREX_D_DECL(a.data(), a.data()+1, a.data()+2)}};
981 }
982
983 template <class T>
984 std::array<T const*,AMREX_SPACEDIM> GetArrOfConstPtrs (const std::array<T*,AMREX_SPACEDIM>& a) noexcept
985 {
986 return {{AMREX_D_DECL(a[0], a[1], a[2])}};
987 }
988
989 template <class T>
990 std::array<T const*,AMREX_SPACEDIM> GetArrOfConstPtrs (const std::array<std::unique_ptr<T>,AMREX_SPACEDIM>& a) noexcept
991 {
992 return {{AMREX_D_DECL(a[0].get(), a[1].get(), a[2].get())}};
993 }
994
995}
996
997namespace amrex
998{
999 inline XDim3 makeXDim3 (const Array<Real,AMREX_SPACEDIM>& a) noexcept
1000 {
1001#if (AMREX_SPACEDIM == 1)
1002 return XDim3{a[0], 0., 0.};
1003#elif (AMREX_SPACEDIM == 2)
1004 return XDim3{a[0], a[1], 0.};
1005#else
1006 return XDim3{a[0], a[1], a[2]};
1007#endif
1008 }
1009}
1010
1011#endif
#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:104
Definition AMReX_Amr.cpp:49
Order
Definition AMReX_SmallMatrix.H:19
Array< int, AMREX_SPACEDIM > IntArray
Definition AMReX_Array.H:27
XDim3 makeXDim3(const Array< Real, AMREX_SPACEDIM > &a) noexcept
Definition AMReX_Array.H:999
AMREX_GPU_HOST_DEVICE constexpr GpuTupleElement< I, GpuTuple< Ts... > >::type & get(GpuTuple< Ts... > &tup) noexcept
Definition AMReX_Tuple.H:179
Array< Real, AMREX_SPACEDIM > RealArray
Definition AMReX_Array.H:26
std::array< T *, AMREX_SPACEDIM > GetArrOfPtrs(std::array< T, AMREX_SPACEDIM > &a) noexcept
Definition AMReX_Array.H:966
std::array< T const *, AMREX_SPACEDIM > GetArrOfConstPtrs(const std::array< T, AMREX_SPACEDIM > &a) noexcept
Definition AMReX_Array.H:978
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr const T & max(const T &a, const T &b) noexcept
Definition AMReX_Algorithm.H:35
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition AMReX.cpp:230
std::array< T, N > Array
Definition AMReX_Array.H:24
Definition AMReX_Array.H:189
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * end() noexcept
Definition AMReX_Array.H:243
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr T product() const noexcept
Definition AMReX_Array.H:284
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr int lo() noexcept
Definition AMReX_Array.H:202
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr unsigned int size() noexcept
Definition AMReX_Array.H:195
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr int hi() noexcept
Definition AMReX_Array.H:208
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * begin() const noexcept
Definition AMReX_Array.H:222
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * begin() noexcept
Definition AMReX_Array.H:236
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr T sum() const noexcept
Definition AMReX_Array.H:273
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * end() const noexcept
Definition AMReX_Array.H:229
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr unsigned int len() noexcept
Definition AMReX_Array.H:215
Definition AMReX_Array.H:333
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr int xlo() noexcept
Definition AMReX_Array.H:347
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr T sum(int axis, int loc) const noexcept
Definition AMReX_Array.H:514
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr int yhi() noexcept
Definition AMReX_Array.H:377
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr unsigned int xlen() noexcept
Definition AMReX_Array.H:362
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr T sum() const noexcept
Definition AMReX_Array.H:480
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr T product() const noexcept
Definition AMReX_Array.H:536
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr T product(int axis, int loc) const noexcept
Definition AMReX_Array.H:571
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * begin() noexcept
Definition AMReX_Array.H:406
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * end() noexcept
Definition AMReX_Array.H:413
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr int xhi() noexcept
Definition AMReX_Array.H:354
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * end() const noexcept
Definition AMReX_Array.H:399
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr int ylo() noexcept
Definition AMReX_Array.H:370
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr unsigned int ylen() noexcept
Definition AMReX_Array.H:385
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * begin() const noexcept
Definition AMReX_Array.H:392
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr unsigned int size() noexcept
Definition AMReX_Array.H:339
Definition AMReX_Array.H:628
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr unsigned int size() noexcept
Definition AMReX_Array.H:634
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr int xlo() noexcept
Definition AMReX_Array.H:642
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr unsigned int ylen() noexcept
Definition AMReX_Array.H:679
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr int yhi() noexcept
Definition AMReX_Array.H:671
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr unsigned int xlen() noexcept
Definition AMReX_Array.H:656
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr T product(const int axis, const int loc0, const int loc1) const noexcept
Definition AMReX_Array.H:911
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr T sum(int axis, int loc0, int loc1) const noexcept
Definition AMReX_Array.H:840
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * end() noexcept
Definition AMReX_Array.H:729
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr unsigned int zlen() noexcept
Definition AMReX_Array.H:701
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr int xhi() noexcept
Definition AMReX_Array.H:649
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * begin() noexcept
Definition AMReX_Array.H:722
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr int zlo() noexcept
Definition AMReX_Array.H:687
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * end() const noexcept
Definition AMReX_Array.H:715
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr int zhi() noexcept
Definition AMReX_Array.H:694
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * begin() const noexcept
Definition AMReX_Array.H:708
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr int ylo() noexcept
Definition AMReX_Array.H:664
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr T sum() const noexcept
Definition AMReX_Array.H:800
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr T product() const noexcept
Definition AMReX_Array.H:870
Definition AMReX_Array.H:34
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * end() const noexcept
Definition AMReX_Array.H:93
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * data() noexcept
Definition AMReX_Array.H:72
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * data() const noexcept
Definition AMReX_Array.H:66
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T product() const noexcept
Definition AMReX_Array.H:134
T & reference_type
Definition AMReX_Array.H:36
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * end() noexcept
Definition AMReX_Array.H:107
T value_type
Definition AMReX_Array.H:35
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T & operator[](int i) const noexcept
Definition AMReX_Array.H:43
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * begin() noexcept
Definition AMReX_Array.H:100
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * begin() const noexcept
Definition AMReX_Array.H:86
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void fill(const T &value) noexcept
Definition AMReX_Array.H:116
T arr[amrex::max(N, 1U)]
Definition AMReX_Array.H:168
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuArray< T, N > & operator+=(GpuArray< T, N > const &a) noexcept
Definition AMReX_Array.H:142
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE constexpr unsigned int size() noexcept
Definition AMReX_Array.H:79
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr T sum() const noexcept
Definition AMReX_Array.H:123
Definition AMReX_Dim3.H:13