diff --git a/Src/Particle/AMReX_MakeParticle.H b/Src/Particle/AMReX_MakeParticle.H index 4b9e35597dc..eaa1f794e9c 100644 --- a/Src/Particle/AMReX_MakeParticle.H +++ b/Src/Particle/AMReX_MakeParticle.H @@ -1,40 +1,43 @@ #ifndef AMREX_MAKEPARTICLE_H_ #define AMREX_MAKEPARTICLE_H_ +#include "AMReX_ParticleTile.H" + #include -template< class T > -struct is_soa_particle - : std::integral_constant< - bool, - T::is_soa_particle - > {}; +namespace amrex { + +template +struct is_soa_particle + : std::integral_constant< + bool, + T::is_soa_particle + > { +}; -template -struct make_particle -{ - template +template +struct make_particle { + template AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE - auto& - operator() (PTD const& ptd, int i) - { + auto & + operator()(PTD const &ptd, int i) { // legacy Particle (AoS) return ptd.m_aos[i]; } }; -template -struct make_particle::value>::type> -{ - template +template +struct make_particle::value>::type> { + template AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto - operator() (PTD const& ptd, int index) - { - // SoAParticle - return T_ParticleType(ptd, index); + operator()(PTD const &ptd, int index) { + // pure SoA particle (by value) + return ConstSoAParticle(ptd, index); } }; +} // namespace amrex + #endif