Skip to content

Commit

Permalink
Add extra braces in initialization of GpuArray (AMReX-Codes#2876)
Browse files Browse the repository at this point in the history
It should not be needed since C++14.  But some compilers seem to need the
double braces.
  • Loading branch information
WeiqunZhang committed Jul 13, 2022
1 parent a633d2b commit 40b3d21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions Src/Base/AMReX_TableData.H
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ struct Table2D
{
T* AMREX_RESTRICT p = nullptr;
Long jstride = 0;
GpuArray<int,2> begin{1,1};
GpuArray<int,2> end{0,0};
GpuArray<int,2> begin{{1,1}};
GpuArray<int,2> end{{0,0}};

AMREX_GPU_HOST_DEVICE
constexpr Table2D () noexcept {}
Expand Down Expand Up @@ -142,8 +142,8 @@ struct Table3D
T* AMREX_RESTRICT p = nullptr;
Long jstride = 0;
Long kstride = 0;
GpuArray<int,3> begin{1,1,1};
GpuArray<int,3> end{0,0,0};
GpuArray<int,3> begin{{1,1,1}};
GpuArray<int,3> end{{0,0,0}};

AMREX_GPU_HOST_DEVICE
constexpr Table3D () noexcept {}
Expand Down Expand Up @@ -213,8 +213,8 @@ struct Table4D
Long jstride = 0;
Long kstride = 0;
Long nstride = 0;
GpuArray<int,4> begin{1,1,1,1};
GpuArray<int,4> end{0,0,0,0};
GpuArray<int,4> begin{{1,1,1,1}};
GpuArray<int,4> end{{0,0,0,0}};

AMREX_GPU_HOST_DEVICE
constexpr Table4D () noexcept {}
Expand Down
2 changes: 1 addition & 1 deletion Src/LinearSolvers/MLMG/AMReX_MLEBNodeFDLaplacian.H
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public:
#endif

private:
GpuArray<Real,AMREX_SPACEDIM> m_sigma{AMREX_D_DECL(1_rt,1_rt,1_rt)};
GpuArray<Real,AMREX_SPACEDIM> m_sigma{{AMREX_D_DECL(1_rt,1_rt,1_rt)}};
Real m_s_phi_eb = std::numeric_limits<Real>::lowest();
Vector<MultiFab> m_phi_eb;
int m_rz = false;
Expand Down

0 comments on commit 40b3d21

Please sign in to comment.