Skip to content

Commit

Permalink
ParticleTileData: No Restrict in Storage (AMReX-Codes#3245)
Browse files Browse the repository at this point in the history
## Summary

Remove the `restrict` qualifier from `GpuArray` members in
`ParticleTileData`. We see compilation problems with, among others Clang
14.0.6 and AppleClang, for this construct.

We expect that using `restrict` (`AMREX_RESTRICT`) on APIs as well as
aliased pointers in these arrays before access should be sufficient to
prevent that the compiler thinks that individual arrays alias each other
in hot loops.

## Additional background

- WarpX build regressions since 23.03, e.g.,
  - conda-forge/warpx-feedstock#63
  - conda-forge/warpx-feedstock#64
  - ECP-WarpX/WarpX#3817
- independently, about to be remove in
AMReX-Codes#2878
  • Loading branch information
ax3l authored and guj committed Jul 13, 2023
1 parent 06be4d3 commit 86ed7d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Src/Particle/AMReX_ParticleTile.H
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ struct ParticleTileData

Long m_size;
ParticleType* AMREX_RESTRICT m_aos;
GpuArray<ParticleReal* AMREX_RESTRICT, NArrayReal> m_rdata;
GpuArray<int* AMREX_RESTRICT, NArrayInt> m_idata;
GpuArray<ParticleReal*, NArrayReal> m_rdata;
GpuArray<int*, NArrayInt> m_idata;

int m_num_runtime_real;
int m_num_runtime_int;
Expand Down Expand Up @@ -170,8 +170,8 @@ struct ConstParticleTileData

Long m_size;
const ParticleType* AMREX_RESTRICT m_aos;
GpuArray<const ParticleReal* AMREX_RESTRICT, NArrayReal> m_rdata;
GpuArray<const int* AMREX_RESTRICT, NArrayInt > m_idata;
GpuArray<const ParticleReal*, NArrayReal> m_rdata;
GpuArray<const int*, NArrayInt> m_idata;

int m_num_runtime_real;
int m_num_runtime_int;
Expand Down

0 comments on commit 86ed7d2

Please sign in to comment.