Skip to content

Commit 86ed7d2

Browse files
ax3lguj
authored andcommitted
ParticleTileData: No Restrict in Storage (AMReX-Codes#3245)
## 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 - BLAST-WarpX/warpx#3817 - independently, about to be remove in AMReX-Codes#2878
1 parent 06be4d3 commit 86ed7d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Src/Particle/AMReX_ParticleTile.H

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ struct ParticleTileData
2222

2323
Long m_size;
2424
ParticleType* AMREX_RESTRICT m_aos;
25-
GpuArray<ParticleReal* AMREX_RESTRICT, NArrayReal> m_rdata;
26-
GpuArray<int* AMREX_RESTRICT, NArrayInt> m_idata;
25+
GpuArray<ParticleReal*, NArrayReal> m_rdata;
26+
GpuArray<int*, NArrayInt> m_idata;
2727

2828
int m_num_runtime_real;
2929
int m_num_runtime_int;
@@ -170,8 +170,8 @@ struct ConstParticleTileData
170170

171171
Long m_size;
172172
const ParticleType* AMREX_RESTRICT m_aos;
173-
GpuArray<const ParticleReal* AMREX_RESTRICT, NArrayReal> m_rdata;
174-
GpuArray<const int* AMREX_RESTRICT, NArrayInt > m_idata;
173+
GpuArray<const ParticleReal*, NArrayReal> m_rdata;
174+
GpuArray<const int*, NArrayInt> m_idata;
175175

176176
int m_num_runtime_real;
177177
int m_num_runtime_int;

0 commit comments

Comments
 (0)