Skip to content

Commit

Permalink
Fix c++11 float narrowing (#1180)
Browse files Browse the repository at this point in the history
Fix a compile issue with DPC++ (SP) and AppleClang (DP):
```
Src/AmrCore/AMReX_ErrorList.cpp:318:52: error: non-constant-expression cannot be narrowed from type 'double' to 'float' in initializer list [-Wc++11-narrowing]
```
  • Loading branch information
ax3l authored Jul 23, 2020
1 parent 3b0aec5 commit 370bccc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Src/AmrCore/AMReX_ErrorList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ operator << (std::ostream& os,
amrex::ParallelFor(bx,
[=] AMREX_GPU_HOST_DEVICE (int i, int j, int k) noexcept
{
GpuArray<Real,AMREX_SPACEDIM> pt = {D_DECL(plo[0]+(i+0.5)*dx[0],
plo[1]+(j+0.5)*dx[1],
plo[2]+(k+0.5)*dx[2])};
GpuArray<Real,AMREX_SPACEDIM> pt = {D_DECL(plo[0]+(Real(i)+0.5_rt)*dx[0],
plo[1]+(Real(j)+0.5_rt)*dx[1],
plo[2]+(Real(k)+0.5_rt)*dx[2])};
if (tag_rb.contains(pt.data())) {
tag(i,j,k) = tagval;
}
Expand Down

0 comments on commit 370bccc

Please sign in to comment.