Skip to content

Commit

Permalink
Fix view
Browse files Browse the repository at this point in the history
  • Loading branch information
squarefk committed Aug 4, 2022
1 parent 88ed450 commit 46ccece
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions cajita/src/Cajita_ParticleDynamicPartitioner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,23 @@ class ParticleDynamicPartitionerWorkloadMeasurer

auto dx_copy = dx;
auto cell_bits_per_tile_dim_copy = cell_bits_per_tile_dim;
auto view_copy = view;
Kokkos::parallel_for(
"compute_local_workload_parpos",
Kokkos::RangePolicy<execution_space>( 0, particle_num ),
KOKKOS_LAMBDA( const int i ) {
int ti =
static_cast<int>(
( view( i, 0 ) - lower_corner[0] ) / dx_copy - 0.5 ) >>
cell_bits_per_tile_dim_copy;
int tj =
static_cast<int>(
( view( i, 1 ) - lower_corner[1] ) / dx_copy - 0.5 ) >>
cell_bits_per_tile_dim_copy;
int tz =
static_cast<int>(
( view( i, 2 ) - lower_corner[2] ) / dx_copy - 0.5 ) >>
cell_bits_per_tile_dim_copy;
int ti = static_cast<int>(
( view_copy( i, 0 ) - lower_corner[0] ) / dx_copy -
0.5 ) >>
cell_bits_per_tile_dim_copy;
int tj = static_cast<int>(
( view_copy( i, 1 ) - lower_corner[1] ) / dx_copy -
0.5 ) >>
cell_bits_per_tile_dim_copy;
int tz = static_cast<int>(
( view_copy( i, 2 ) - lower_corner[2] ) / dx_copy -
0.5 ) >>
cell_bits_per_tile_dim_copy;
Kokkos::atomic_increment( &workload( ti + 1, tj + 1, tz + 1 ) );
} );
Kokkos::fence();
Expand Down

0 comments on commit 46ccece

Please sign in to comment.