Skip to content

Commit 546cc5e

Browse files
authored
Force the alignment of SoA and AoS Particles (#4375)
This fixes build issues on 32-bit Linux. This should not affect 64 bits machines. Fix #4371
1 parent eae3e36 commit 546cc5e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Src/Particle/AMReX_Particle.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ struct SoAParticleBase
290290
* \tparam T_NInt The number of extra integer components
291291
*/
292292
template <int T_NReal, int T_NInt=0>
293-
struct Particle
293+
struct alignas(sizeof(double)) Particle
294294
: ParticleBase<ParticleReal,T_NReal,T_NInt>
295295
{
296296
static constexpr bool is_soa_particle = false;

Src/Particle/AMReX_ParticleTile.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ struct ParticleTileData
311311

312312
// SOA Particle Structure
313313
template <int T_NArrayReal, int T_NArrayInt>
314-
struct ConstSoAParticle : SoAParticleBase
314+
struct alignas(sizeof(double)) ConstSoAParticle : SoAParticleBase
315315
{
316316
static constexpr int NArrayReal = T_NArrayReal;
317317
static constexpr int NArrayInt = T_NArrayInt;
@@ -373,7 +373,7 @@ struct ConstSoAParticle : SoAParticleBase
373373
};
374374

375375
template <int T_NArrayReal, int T_NArrayInt>
376-
struct SoAParticle : SoAParticleBase
376+
struct alignas(sizeof(double)) SoAParticle : SoAParticleBase
377377
{
378378
static constexpr int NArrayReal = T_NArrayReal;
379379
static constexpr int NArrayInt = T_NArrayInt;

0 commit comments

Comments
 (0)