Skip to content

Commit

Permalink
fixup: fences
Browse files Browse the repository at this point in the history
  • Loading branch information
streeve committed Jan 6, 2025
1 parent 69e2d77 commit e121d8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/CabanaPD_Particles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ class Particles<MemorySpace, PMB, TemperatureIndependent, BaseOutput, Dimension>

return create;
};
// Fence inside create.
auto local_created = Cabana::Grid::createParticles(
init_type, exec_space, create_functor, _plist_x, particles_per_cell,
*local_grid, num_previous, false );
Expand Down Expand Up @@ -426,6 +427,7 @@ class Particles<MemorySpace, PMB, TemperatureIndependent, BaseOutput, Dimension>
nofail( pid ) = 0;
rho( pid ) = 1.0;
} );
Kokkos::fence();

updateGlobal();
}
Expand All @@ -451,6 +453,7 @@ class Particles<MemorySpace, PMB, TemperatureIndependent, BaseOutput, Dimension>
Kokkos::parallel_for(
"CabanaPD::Particles::update_particles", policy,
KOKKOS_LAMBDA( const int pid ) { init_functor( pid ); } );
Kokkos::fence();
_timer.stop();
}

Expand Down

0 comments on commit e121d8e

Please sign in to comment.