Skip to content

Commit

Permalink
revert to one int for each id for now
Browse files Browse the repository at this point in the history
  • Loading branch information
atmyers committed Nov 2, 2022
1 parent 4dbfbac commit d771fc8
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions Src/Particle/AMReX_ParticleTile.H
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ struct ParticleTileData
}
};

// SOA Particle Structure
// SOA Particle Structure
template <int T_NArrayReal, int T_NArrayInt>
struct SoAParticle : SoAParticleBase
{
Expand All @@ -217,37 +217,25 @@ struct SoAParticle : SoAParticleBase

static Long the_next_id;

SoAParticle (PTD ptd, int const index)
SoAParticle (PTD ptd, int const index)
{
m_particle_tile_data=ptd;
m_index=index;
}

//functions to get id and cpu in the SOA data

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
ParticleCPUWrapper cpu () & {
uint64_t unsigned_cpu_value;
unsigned_cpu_value = (uint64_t) this->m_particle_tile_data.m_idata[1][m_index];
return ParticleCPUWrapper(unsigned_cpu_value); }
int& cpu () & { return this->m_particle_tile_data.m_idata[1][m_index]; }

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
ParticleIDWrapper id () & {
uint64_t unsigned_id_value;
unsigned_id_value = (uint64_t) this->m_particle_tile_data.m_idata[0][m_index];
return ParticleIDWrapper(unsigned_id_value); }
int& id () & { return this->m_particle_tile_data.m_idata[0][m_index]; }

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
ConstParticleCPUWrapper cpu () const & {
uint64_t unsigned_cpu_value;
unsigned_cpu_value = (uint64_t) this->m_particle_tile_data.m_idata[1][m_index];
return ConstParticleCPUWrapper(unsigned_cpu_value); }
const int& cpu () const & { return this->m_particle_tile_data.m_idata[1][m_index]; }

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
ConstParticleIDWrapper id () const & {
uint64_t unsigned_id_value;
unsigned_id_value = (uint64_t) this->m_particle_tile_data.m_idata[0][m_index];
return ConstParticleIDWrapper(unsigned_id_value); }
const int& id () const & { return this->m_particle_tile_data.m_idata[0][m_index]; }

//functions to get positions of the particle in the SOA data

Expand Down

0 comments on commit d771fc8

Please sign in to comment.