-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable m_aos for SoA Particle #3736
Conversation
Change the type of m_aos for SoA particle to void*. Because void* cannot be dereferenced, this can avoid bugs that use m_aos on SoA particles.
@@ -18,9 +18,12 @@ auto call_f (F const& f, | |||
GpuArray<Real,AMREX_SPACEDIM> const& plo, | |||
GpuArray<Real,AMREX_SPACEDIM> const& dxi) noexcept | |||
{ | |||
if constexpr (IsCallable<F, decltype(p.m_aos[i]), decltype(fabarr), decltype(plo), decltype(dxi)>::value) { | |||
using PTDTypeT = std::remove_const_t<std::remove_reference_t<decltype(p)>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add #include <type_traits>
to this file for robustness :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isen't PTDTypeT
the same as PTDType<T_ParticleType, NAR, NAI>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Maybe it's silly to do it like this, but I just didn't want to introduce typos.
## Summary Move into type to mitigate MSVC compile errors: ``` Src\Particle\AMReX_ParticleTile.H(48,5): error C2219: syntax error: type qualifier must be after '*' ``` ## Additional background Follow-up to #3736. Seen in ECP-WarpX/WarpX#4654 ## Checklist The proposed changes: - [x] 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
Change the type of m_aos for SoA particle to void*. Because void* cannot be dereferenced, this can avoid bugs that use m_aos on SoA particles.