Skip to content
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

Merged
merged 3 commits into from
Jan 31, 2024
Merged

Conversation

WeiqunZhang
Copy link
Member

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.

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.
@WeiqunZhang WeiqunZhang requested review from atmyers and ax3l January 31, 2024 02:36
@ax3l ax3l requested a review from AlexanderSinn January 31, 2024 02:58
@@ -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)>>;
Copy link
Member

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 :)

Copy link
Member

@AlexanderSinn AlexanderSinn Jan 31, 2024

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>?

Copy link
Member Author

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.

@ax3l ax3l enabled auto-merge (squash) January 31, 2024 06:03
@ax3l ax3l merged commit d861bdf into AMReX-Codes:development Jan 31, 2024
69 checks passed
@ax3l ax3l mentioned this pull request Jan 31, 2024
5 tasks
WeiqunZhang pushed a commit that referenced this pull request Jan 31, 2024
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants