Skip to content

Commit

Permalink
Explicit Capture Group by Alex
Browse files Browse the repository at this point in the history
Co-authored-by: AlexanderSinn <[email protected]>
  • Loading branch information
ax3l and AlexanderSinn authored Aug 24, 2023
1 parent 784ea5f commit 481f66c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Src/Particle/AMReX_ParticleTransformation.H
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,16 @@ Index filterParticles (DstTile& dst, const SrcTile& src, Pred&& p,
auto* p_mask = mask.dataPtr();
const auto src_data = src.getConstParticleTileData();

if constexpr (IsCallable<Pred,decltype(src_data),Index,RandomEngine>::value) {
amrex::ParallelForRNG(n,
[p, p_mask, src_data, src_start] AMREX_GPU_DEVICE (int i, amrex::RandomEngine const& engine) noexcept
{
amrex::ignore_unused(p, p_mask, src_data, src_start, engine);
if constexpr (IsCallable<Pred,decltype(src_data),Index,RandomEngine>::value) {
p_mask[i] = p(src_data, src_start+i, engine);
} else {
p_mask[i] = p(src_data, src_start+i);
}
});
amrex::ParallelForRNG(n,
[=] AMREX_GPU_DEVICE (int i, amrex::RandomEngine const& engine) noexcept
{
Expand Down

0 comments on commit 481f66c

Please sign in to comment.