Skip to content

Commit 5c2bd39

Browse files
committed
Fix view
1 parent a53aaea commit 5c2bd39

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

cajita/src/Cajita_ParticleDynamicPartitioner.hpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,23 @@ class ParticleDynamicPartitionerWorkloadMeasurer
8686

8787
auto dx_copy = dx;
8888
auto cell_bits_per_tile_dim_copy = cell_bits_per_tile_dim;
89+
auto view_copy = view;
8990
Kokkos::parallel_for(
9091
"compute_local_workload_parpos",
9192
Kokkos::RangePolicy<execution_space>( 0, particle_num ),
9293
KOKKOS_LAMBDA( const int i ) {
93-
int ti =
94-
static_cast<int>(
95-
( view( i, 0 ) - lower_corner[0] ) / dx_copy - 0.5 ) >>
96-
cell_bits_per_tile_dim_copy;
97-
int tj =
98-
static_cast<int>(
99-
( view( i, 1 ) - lower_corner[1] ) / dx_copy - 0.5 ) >>
100-
cell_bits_per_tile_dim_copy;
101-
int tz =
102-
static_cast<int>(
103-
( view( i, 2 ) - lower_corner[2] ) / dx_copy - 0.5 ) >>
104-
cell_bits_per_tile_dim_copy;
94+
int ti = static_cast<int>(
95+
( view_copy( i, 0 ) - lower_corner[0] ) / dx_copy -
96+
0.5 ) >>
97+
cell_bits_per_tile_dim_copy;
98+
int tj = static_cast<int>(
99+
( view_copy( i, 1 ) - lower_corner[1] ) / dx_copy -
100+
0.5 ) >>
101+
cell_bits_per_tile_dim_copy;
102+
int tz = static_cast<int>(
103+
( view_copy( i, 2 ) - lower_corner[2] ) / dx_copy -
104+
0.5 ) >>
105+
cell_bits_per_tile_dim_copy;
105106
Kokkos::atomic_increment( &workload( ti + 1, tj + 1, tz + 1 ) );
106107
} );
107108
Kokkos::fence();

0 commit comments

Comments
 (0)