@@ -34,7 +34,7 @@ namespace ArrayUtil
3434 amrex::Real arr[(XHI-XLO+1 )];
3535 };
3636
37- template <int XLO, int XHI, int YLO, int YHI>
37+ template <typename T, int XLO, int XHI, int YLO, int YHI>
3838 struct MathArray2D
3939 {
4040 AMREX_GPU_HOST_DEVICE AMREX_INLINE
@@ -71,7 +71,7 @@ namespace ArrayUtil
7171 }
7272
7373 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
74- amrex::Real get (const int i, const int j) const noexcept {
74+ T get (const int i, const int j) const noexcept {
7575 AMREX_ASSERT (i >= XLO && i <= XHI && j >= YLO && j <= YHI);
7676 return arr[i+j*(XHI-XLO+1 )-(YLO*(XHI-XLO+1 )+XLO)];
7777 }
@@ -84,18 +84,18 @@ namespace ArrayUtil
8484 }
8585
8686 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
87- const amrex::Real & operator () (int i, int j) const noexcept {
87+ const T & operator () (int i, int j) const noexcept {
8888 AMREX_ASSERT (i >= XLO && i <= XHI && j >= YLO && j <= YHI);
8989 return arr[i+j*(XHI-XLO+1 )-(YLO*(XHI-XLO+1 )+XLO)];
9090 }
9191
9292 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
93- amrex::Real & operator () (int i, int j) noexcept {
93+ T & operator () (int i, int j) noexcept {
9494 AMREX_ASSERT (i >= XLO && i <= XHI && j >= YLO && j <= YHI);
9595 return arr[i+j*(XHI-XLO+1 )-(YLO*(XHI-XLO+1 )+XLO)];
9696 }
9797
98- amrex::Real arr[(XHI-XLO+1 )*(YHI-YLO+1 )];
98+ T arr[(XHI-XLO+1 )*(YHI-YLO+1 )];
9999 };
100100
101101 namespace Math
0 commit comments