Skip to content

Commit

Permalink
Silence "unreachable loop" warning for GPU builds (#3462)
Browse files Browse the repository at this point in the history
This silences warnings like `Src/Base/AMReX_PODVector.H(126): warning
#128-D: loop is not reachable`

The proposed changes:
- [ ] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX
users
- [ ] include documentation in the code and/or rst files, if appropriate
  • Loading branch information
atmyers authored Aug 1, 2023
1 parent ebe604a commit 2736683
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Src/Base/AMReX_PODVector.H
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,12 @@ namespace amrex
return;
}
}
#else
static_assert(RunOnGpu<Allocator<T>>::value == false);
#endif
for (Size i = 0; i < count; ++i) { dst[i] = src[i]; }
if constexpr (! RunOnGpu<Allocator<T>>::value) {
for (Size i = 0; i < count; ++i) { dst[i] = src[i]; }
}
}

template <typename Allocator>
Expand Down

0 comments on commit 2736683

Please sign in to comment.