Skip to content

Commit

Permalink
Merge pull request #719 from streeve/fixup_global_comm_test
Browse files Browse the repository at this point in the history
Add missing device copy in 2d global comm test
  • Loading branch information
streeve authored Nov 30, 2023
2 parents d883c13 + cdf450f commit 3566185
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion grid/unit_test/tstGlobalParticleComm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,23 @@ void testMigrate2d()
using RandomType = Kokkos::Random_XorShift64<TEST_EXECSPACE>;
PoolType pool( 174748 );

// Copy box bounds to device array.
Kokkos::Array<double, 2> global_low_kokkos;
Kokkos::Array<double, 2> global_high_kokkos;
for ( int d = 0; d < 2; ++d )
{
global_low_kokkos[d] = global_low[d];
global_high_kokkos[d] = global_high[d];
}

// Create particles randomly in the global domain.
auto random_coord_op = KOKKOS_LAMBDA( const int p )
{
auto gen = pool.get_state();
for ( int d = 0; d < 2; ++d )
{
position( p, d ) = Kokkos::rand<RandomType, double>::draw(
gen, global_low[d], global_high[d] );
gen, global_low_kokkos[d], global_high_kokkos[d] );
}
pool.free_state( gen );
};
Expand Down

0 comments on commit 3566185

Please sign in to comment.