diff --git a/grid/unit_test/tstGlobalParticleComm.hpp b/grid/unit_test/tstGlobalParticleComm.hpp index 4c1cbd0ea..99b40453f 100644 --- a/grid/unit_test/tstGlobalParticleComm.hpp +++ b/grid/unit_test/tstGlobalParticleComm.hpp @@ -173,6 +173,15 @@ void testMigrate2d() using RandomType = Kokkos::Random_XorShift64; PoolType pool( 174748 ); + // Copy box bounds to device array. + Kokkos::Array global_low_kokkos; + Kokkos::Array 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 ) { @@ -180,7 +189,7 @@ void testMigrate2d() for ( int d = 0; d < 2; ++d ) { position( p, d ) = Kokkos::rand::draw( - gen, global_low[d], global_high[d] ); + gen, global_low_kokkos[d], global_high_kokkos[d] ); } pool.free_state( gen ); };