Block-Structured AMR Software Framework
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>
6 #include <AMReX_GpuQualifiers.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 <string>
19 #include <type_traits>
20 
21 namespace amrex {
22 
23  template <class T, std::size_t N>
24  using Array = std::array<T,N>;
25 
28 
29 }
30 
31 namespace 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 { return arr[i]; }
44 
50  T& operator [] (int i) noexcept { return arr[i]; }
51 
56  const T* data () const noexcept { return arr; }
57 
62  T* data () noexcept { return arr; }
63 
69  static constexpr unsigned int size () noexcept { return N; }
70 
76  const T* begin () const noexcept { return arr; }
77 
83  const T* end () const noexcept { return arr + N; }
84 
90  T* begin () noexcept { return arr; }
91 
97  T* end () noexcept { return arr + N; }
98 
106  void fill ( const T& value ) noexcept
107  { for (unsigned int i = 0; i < N; ++i) { arr[i] = value; } }
108 
113  constexpr T sum () const noexcept
114  {
115  T s = 0;
116  for (unsigned int i = 0; i < N; ++i) { s += arr[i]; }
117  return s;
118  }
119 
124  T product () const noexcept
125  {
126  T p = 1;
127  for (unsigned int i = 0; i < N; ++i) { p *= arr[i]; }
128  return p;
129  }
130 
133  {
134  for (unsigned int i = 0; i < N; ++i) {
135  arr[i] += a.arr[i];
136  }
137  return *this;
138  }
139 
140  T arr[amrex::max(N,1U)];
141  };
142 }
143 
144 namespace amrex {
145 
159  template <class T, int XLO, int XHI>
160  struct Array1D
161  {
167  static constexpr unsigned int size () noexcept { return (XHI-XLO+1); }
168 
174  static constexpr int lo () noexcept { return XLO; }
175 
180  static constexpr int hi () noexcept { return XHI; }
181 
187  static constexpr unsigned int len () noexcept { return (XHI-XLO+1); }
188 
194  const T* begin () const noexcept { return arr; }
195 
201  const T* end () const noexcept { return arr + XHI-XLO+1; }
202 
208  T* begin () noexcept { return arr; }
209 
215  T* end () noexcept { return arr + XHI-XLO+1; }
216 
222  const T& operator() (int i) const noexcept {
223  AMREX_ASSERT(i >= XLO && i <= XHI);
224  return arr[i-XLO];
225  }
226 
232  T& operator() (int i) noexcept {
233  AMREX_ASSERT(i >= XLO && i <= XHI);
234  return arr[i-XLO];
235  }
236 
241  constexpr T sum () const noexcept
242  {
243  T s = 0;
244  for (int i = XLO; i <= XHI; ++i) { s += arr[i-XLO]; }
245  return s;
246  }
247 
252  constexpr T product() const noexcept
253  {
254  T p = 1;
255  for (int i = 0; i < (XHI-XLO+1); ++i) {
256  p *= arr[i];
257  }
258  return p;
259  }
260 
265  T arr[(XHI-XLO+1)];
266  };
267 
279  template <class T, int XLO, int XHI, int YLO, int YHI,
280  Order ORDER = Order::F>
281  struct Array2D
282  {
288  static constexpr unsigned int size() noexcept { return (XHI-XLO+1)*(YHI-YLO+1); }
289 
296  static constexpr int xlo () noexcept { return XLO; }
297 
303  static constexpr int xhi () noexcept { return XHI; }
304 
305 
311  static constexpr unsigned int xlen () noexcept { return (XHI-XLO+1); }
312 
319  static constexpr int ylo () noexcept { return YLO; }
320 
326  static constexpr int yhi () noexcept { return YHI; }
327 
328 
334  static constexpr unsigned int ylen () noexcept { return (YHI-YLO+1); }
335 
341  const T* begin () const noexcept { return arr; }
342 
348  const T* end () const noexcept { return arr + (XHI-XLO+1)*(YHI-YLO+1); }
349 
355  T* begin () noexcept { return arr; }
356 
362  T* end () noexcept { return arr + (XHI-XLO+1)*(YHI-YLO+1); }
363 
370  template <Order Ord=ORDER, std::enable_if_t<Ord==Order::F,int> = 0>
372  const T& operator() (int i, int j) const noexcept {
373  AMREX_ASSERT(i >= XLO && i <= XHI && j >= YLO && j <= YHI);
374  return arr[i+j*(XHI-XLO+1)-(YLO*(XHI-XLO+1)+XLO)];
375  }
376 
383  template <Order Ord=ORDER, std::enable_if_t<Ord==Order::F,int> = 0>
385  T& operator() (int i, int j) noexcept {
386  AMREX_ASSERT(i >= XLO && i <= XHI && j >= YLO && j <= YHI);
387  return arr[i+j*(XHI-XLO+1)-(YLO*(XHI-XLO+1)+XLO)];
388  }
389 
396  template <Order Ord=ORDER, std::enable_if_t<Ord==Order::C,int> = 0>
398  const T& operator() (int i, int j) const noexcept {
399  AMREX_ASSERT(i >= XLO && i <= XHI && j >= YLO && j <= YHI);
400  return arr[j+i*(YHI-YLO+1)-(XLO*(YHI-YLO+1)+YLO)];
401  }
402 
409  template <Order Ord=ORDER, std::enable_if_t<Ord==Order::C,int> = 0>
411  T& operator() (int i, int j) noexcept {
412  AMREX_ASSERT(i >= XLO && i <= XHI && j >= YLO && j <= YHI);
413  return arr[j+i*(YHI-YLO+1)-(XLO*(YHI-YLO+1)+YLO)];
414  }
415 
421  constexpr T sum () const noexcept
422  {
423  T s = 0;
424  for (int i = 0; i < (XHI-XLO+1)*(YHI-YLO+1); ++i) {
425  s += arr[i];
426  }
427  return s;
428  }
429 
455  constexpr T sum (int axis, int loc) const noexcept
456  {
457  T s = 0;
458  if (axis == 0) {
459  int j = loc;
460  for (int i = XLO; i <= XHI; ++i) {
461  s += this->operator()(i,j);
462  }
463  } else if (axis == 1) {
464  int i = loc;
465  for (int j = YLO; j <= YHI; ++j) {
466  s += this->operator()(i,j);
467  }
468  }
469  return s;
470  }
471 
477  constexpr T product () const noexcept
478  {
479  T p = 1;
480  for (int i = 0; i < (XHI-XLO+1)*(YHI-YLO+1); ++i) {
481  p *= arr[i];
482  }
483  return p;
484  }
485 
512  constexpr T product (int axis, int loc) const noexcept
513  {
514  T p = 1;
515  if (axis == 0) {
516  int j = loc;
517  for (int i = XLO; i <= XHI; ++i) {
518  p *= this->operator()(i,j);
519  }
520  } else if (axis == 1) {
521  int i = loc;
522  for (int j = YLO; j <= YHI; ++j) {
523  p *= this->operator()(i,j);
524  }
525  }
526  return p;
527  }
528 
529  T arr[(XHI-XLO+1)*(YHI-YLO+1)];
530  };
531 
532 
546  template <class T, int XLO, int XHI, int YLO, int YHI, int ZLO, int ZHI,
547  Order ORDER=Order::F>
548  struct Array3D
549  {
555  static constexpr unsigned int size () noexcept { return (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); }
556 
563  static constexpr int xlo () noexcept { return XLO; }
564 
570  static constexpr int xhi () noexcept { return XHI; }
571 
577  static constexpr unsigned int xlen () noexcept { return (XHI-XLO+1); }
578 
585  static constexpr int ylo () noexcept { return YLO; }
586 
592  static constexpr int yhi () noexcept { return YHI; }
593 
594 
600  static constexpr unsigned int ylen () noexcept { return (YHI-YLO+1); }
601 
608  static constexpr int zlo () noexcept { return ZLO; }
609 
615  static constexpr int zhi () noexcept { return ZHI; }
616 
622  static constexpr unsigned int zlen () noexcept { return (ZHI-ZLO+1); }
623 
629  const T* begin () const noexcept { return arr; }
630 
636  const T* end () const noexcept { return arr + (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); }
637 
643  T* begin () noexcept { return arr; }
644 
650  T* end () noexcept { return arr + (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); }
651 
658  template <Order Ord=ORDER, std::enable_if_t<Ord==Order::F,int> = 0>
660  const T& operator() (int i, int j, int k) const noexcept {
661  return arr[i+j*(XHI-XLO+1)+k*((XHI-XLO+1)*(YHI-YLO+1))
662  -(ZLO*((XHI-XLO+1)*(YHI-YLO+1))+YLO*(XHI-XLO+1)+XLO)];
663  }
664 
671  template <Order Ord=ORDER, std::enable_if_t<Ord==Order::F,int> = 0>
673  T& operator() (int i, int j, int k) noexcept {
674  return arr[i+j*(XHI-XLO+1)+k*((XHI-XLO+1)*(YHI-YLO+1))
675  -(ZLO*((XHI-XLO+1)*(YHI-YLO+1))+YLO*(XHI-XLO+1)+XLO)];
676  }
677 
684  template <Order Ord=ORDER, std::enable_if_t<Ord==Order::C,int> = 0>
686  const T& operator() (int i, int j, int k) const noexcept {
687  return arr[k+j*(ZHI-ZLO+1)+i*((ZHI-ZLO+1)*(YHI-YLO+1))
688  -(XLO*((ZHI-ZLO+1)*(YHI-YLO+1))+YLO*(ZHI-ZLO+1)+ZLO)];
689  }
690 
697  template <Order Ord=ORDER, std::enable_if_t<Ord==Order::C,int> = 0>
699  T& operator() (int i, int j, int k) noexcept {
700  return arr[k+j*(ZHI-ZLO+1)+i*((ZHI-ZLO+1)*(YHI-YLO+1))
701  -(XLO*((ZHI-ZLO+1)*(YHI-YLO+1))+YLO*(ZHI-ZLO+1)+ZLO)];
702  }
703 
709  constexpr T sum () const noexcept
710  {
711  T s = 0;
712  for (int i = 0; i < (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); ++i) {
713  s += arr[i];
714  }
715  return s;
716  }
717 
749  constexpr T sum (int axis, int loc0, int loc1) const noexcept
750  {
751  T s = 0;
752  if (axis == 0) {
753  int j = loc0;
754  int k = loc1;
755  for (int i = XLO; i <= XHI; ++i) {
756  s += this->operator()(i,j,k);
757  }
758  } else if (axis == 1) {
759  int i = loc0;
760  int k = loc1;
761  for (int j = YLO; j <= YHI; ++j) {
762  s += this->operator()(i,j,k);
763  }
764  } else if (axis == 2) {
765  int i = loc0;
766  int j = loc1;
767  for (int k = ZLO; k <= ZHI; ++k) {
768  s += this->operator()(i,j,k);
769  }
770  }
771  return s;
772  }
773 
779  constexpr T product () const noexcept
780  {
781  T p = 1;
782  for (int i = 0; i < (XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1); ++i) {
783  p *= arr[i];
784  }
785  return p;
786  }
787 
788 
820  constexpr T product (const int axis, const int loc0, const int loc1) const noexcept
821  {
822  T p = 1;
823  if (axis == 0) {
824  int j = loc0;
825  int k = loc1;
826  for (int i = XLO; i <= XHI; ++i) {
827  p *= this->operator()(i,j,k);
828  }
829  } else if (axis == 1) {
830  int i = loc0;
831  int k = loc1;
832  for (int j = YLO; j <= YHI; ++j) {
833  p *= this->operator()(i,j,k);
834  }
835  } else if (axis == 2) {
836  int i = loc0;
837  int j = loc1;
838  for (int k = ZLO; k <= ZHI; ++k) {
839  p *= this->operator()(i,j,k);
840  }
841  }
842  return p;
843  }
844 
845  T arr[(XHI-XLO+1)*(YHI-YLO+1)*(ZHI-ZLO+1)];
846  };
847 }
848 
849 namespace amrex
850 {
851  template <class T, typename = typename T::FABType>
852  std::array<T*,AMREX_SPACEDIM> GetArrOfPtrs (std::array<T,AMREX_SPACEDIM>& a) noexcept
853  {
854  return {{AMREX_D_DECL(a.data(), a.data()+1, a.data()+2)}};
855  }
856 
857  template <class T>
858  std::array<T*,AMREX_SPACEDIM> GetArrOfPtrs (const std::array<std::unique_ptr<T>,AMREX_SPACEDIM>& a) noexcept
859  {
860  return {{AMREX_D_DECL(a[0].get(), a[1].get(), a[2].get())}};
861  }
862 
863  template <class T>
864  std::array<T const*,AMREX_SPACEDIM> GetArrOfConstPtrs (const std::array<T,AMREX_SPACEDIM>& a) noexcept
865  {
866  return {{AMREX_D_DECL(a.data(), a.data()+1, a.data()+2)}};
867  }
868 
869  template <class T>
870  std::array<T const*,AMREX_SPACEDIM> GetArrOfConstPtrs (const std::array<T*,AMREX_SPACEDIM>& a) noexcept
871  {
872  return {{AMREX_D_DECL(a[0], a[1], a[2])}};
873  }
874 
875  template <class T>
876  std::array<T const*,AMREX_SPACEDIM> GetArrOfConstPtrs (const std::array<std::unique_ptr<T>,AMREX_SPACEDIM>& a) noexcept
877  {
878  return {{AMREX_D_DECL(a[0].get(), a[1].get(), a[2].get())}};
879  }
880 
881 }
882 
883 namespace amrex
884 {
885  inline XDim3 makeXDim3 (const Array<Real,AMREX_SPACEDIM>& a) noexcept
886  {
887 #if (AMREX_SPACEDIM == 1)
888  return XDim3{a[0], 0., 0.};
889 #elif (AMREX_SPACEDIM == 2)
890  return XDim3{a[0], a[1], 0.};
891 #else
892  return XDim3{a[0], a[1], a[2]};
893 #endif
894  }
895 }
896 
897 #endif
#define AMREX_ASSERT(EX)
Definition: AMReX_BLassert.H:38
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#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
std::array< T const *, AMREX_SPACEDIM > GetArrOfConstPtrs(const std::array< T, AMREX_SPACEDIM > &a) noexcept
Definition: AMReX_Array.H:864
Order
Definition: AMReX_SmallMatrix.H:19
Array< int, AMREX_SPACEDIM > IntArray
Definition: AMReX_Array.H:27
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & max(const T &a, const T &b) noexcept
Definition: AMReX_Algorithm.H:35
std::array< T *, AMREX_SPACEDIM > GetArrOfPtrs(std::array< T, AMREX_SPACEDIM > &a) noexcept
Definition: AMReX_Array.H:852
constexpr AMREX_GPU_HOST_DEVICE GpuTupleElement< I, GpuTuple< Ts... > >::type & get(GpuTuple< Ts... > &tup) noexcept
Definition: AMReX_Tuple.H:179
XDim3 makeXDim3(const Array< Real, AMREX_SPACEDIM > &a) noexcept
Definition: AMReX_Array.H:885
Array< Real, AMREX_SPACEDIM > RealArray
Definition: AMReX_Array.H:26
std::array< T, N > Array
Definition: AMReX_Array.H:24
Definition: AMReX_Array.H:161
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * end() noexcept
Definition: AMReX_Array.H:215
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T & operator()(int i) const noexcept
Definition: AMReX_Array.H:222
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int lo() noexcept
Definition: AMReX_Array.H:174
T arr[(XHI-XLO+1)]
Definition: AMReX_Array.H:265
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * begin() noexcept
Definition: AMReX_Array.H:208
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * begin() const noexcept
Definition: AMReX_Array.H:194
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int hi() noexcept
Definition: AMReX_Array.H:180
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T sum() const noexcept
Definition: AMReX_Array.H:241
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int len() noexcept
Definition: AMReX_Array.H:187
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int size() noexcept
Definition: AMReX_Array.H:167
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * end() const noexcept
Definition: AMReX_Array.H:201
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T product() const noexcept
Definition: AMReX_Array.H:252
Definition: AMReX_Array.H:282
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int xhi() noexcept
Definition: AMReX_Array.H:303
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * begin() const noexcept
Definition: AMReX_Array.H:341
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T sum() const noexcept
Definition: AMReX_Array.H:421
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T product() const noexcept
Definition: AMReX_Array.H:477
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * begin() noexcept
Definition: AMReX_Array.H:355
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int yhi() noexcept
Definition: AMReX_Array.H:326
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int ylen() noexcept
Definition: AMReX_Array.H:334
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int xlo() noexcept
Definition: AMReX_Array.H:296
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * end() noexcept
Definition: AMReX_Array.H:362
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int xlen() noexcept
Definition: AMReX_Array.H:311
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T sum(int axis, int loc) const noexcept
Definition: AMReX_Array.H:455
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int ylo() noexcept
Definition: AMReX_Array.H:319
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int size() noexcept
Definition: AMReX_Array.H:288
T arr[(XHI-XLO+1) *(YHI-YLO+1)]
Definition: AMReX_Array.H:529
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * end() const noexcept
Definition: AMReX_Array.H:348
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T & operator()(int i, int j) const noexcept
Definition: AMReX_Array.H:372
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T product(int axis, int loc) const noexcept
Definition: AMReX_Array.H:512
Definition: AMReX_Array.H:549
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int yhi() noexcept
Definition: AMReX_Array.H:592
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * end() noexcept
Definition: AMReX_Array.H:650
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T sum(int axis, int loc0, int loc1) const noexcept
Definition: AMReX_Array.H:749
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * begin() const noexcept
Definition: AMReX_Array.H:629
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * end() const noexcept
Definition: AMReX_Array.H:636
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int xlen() noexcept
Definition: AMReX_Array.H:577
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int zlen() noexcept
Definition: AMReX_Array.H:622
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int zhi() noexcept
Definition: AMReX_Array.H:615
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int size() noexcept
Definition: AMReX_Array.H:555
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int xhi() noexcept
Definition: AMReX_Array.H:570
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int ylen() noexcept
Definition: AMReX_Array.H:600
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T product(const int axis, const int loc0, const int loc1) const noexcept
Definition: AMReX_Array.H:820
T arr[(XHI-XLO+1) *(YHI-YLO+1) *(ZHI-ZLO+1)]
Definition: AMReX_Array.H:845
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * begin() noexcept
Definition: AMReX_Array.H:643
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T product() const noexcept
Definition: AMReX_Array.H:779
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int ylo() noexcept
Definition: AMReX_Array.H:585
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int zlo() noexcept
Definition: AMReX_Array.H:608
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T sum() const noexcept
Definition: AMReX_Array.H:709
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T & operator()(int i, int j, int k) const noexcept
Definition: AMReX_Array.H:660
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE int xlo() noexcept
Definition: AMReX_Array.H:563
Definition: AMReX_Array.H:34
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T product() const noexcept
Definition: AMReX_Array.H:124
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE T sum() const noexcept
Definition: AMReX_Array.H:113
T & reference_type
Definition: AMReX_Array.H:36
T value_type
Definition: AMReX_Array.H:35
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * data() const noexcept
Definition: AMReX_Array.H:56
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * data() noexcept
Definition: AMReX_Array.H:62
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE unsigned int size() noexcept
Definition: AMReX_Array.H:69
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T * end() noexcept
Definition: AMReX_Array.H:97
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:90
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void fill(const T &value) noexcept
Definition: AMReX_Array.H:106
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * begin() const noexcept
Definition: AMReX_Array.H:76
T arr[amrex::max(N, 1U)]
Definition: AMReX_Array.H:140
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const T * end() const noexcept
Definition: AMReX_Array.H:83
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuArray< T, N > & operator+=(GpuArray< T, N > const &a) noexcept
Definition: AMReX_Array.H:132
Definition: AMReX_Dim3.H:13