Skip to content

Commit

Permalink
Merge pull request #616 from masterleinad/use_team_vectorrange_brutef…
Browse files Browse the repository at this point in the history
…orce
  • Loading branch information
aprokop committed Jan 21, 2022
2 parents 6794807 + 45b6801 commit 6aca3b8
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions src/details/ArborX_DetailsBruteForceImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,19 @@ struct BruteForceImpl
predicates_per_team);
ScratchPrimitiveType scratch_primitives(teamMember.team_scratch(0),
primitives_per_team);
// rank 0 in each team fills the scratch space with the
// predicates / primitives in the tile
if (teamMember.team_rank() == 0)
{
Kokkos::parallel_for(
Kokkos::ThreadVectorRange(teamMember, predicates_in_this_team),
[&](const int q) {
scratch_predicates(q) =
AccessPredicates::get(predicates, predicate_start + q);
});
Kokkos::parallel_for(
Kokkos::ThreadVectorRange(teamMember, primitives_in_this_team),
[&](const int j) {
scratch_primitives(j) =
AccessPrimitives::get(primitives, primitive_start + j);
});
}
// fill the scratch space with the predicates / primitives in the tile
Kokkos::parallel_for(
Kokkos::TeamVectorRange(teamMember, predicates_in_this_team),
[&](const int q) {
scratch_predicates(q) =
AccessPredicates::get(predicates, predicate_start + q);
});
Kokkos::parallel_for(
Kokkos::TeamVectorRange(teamMember, primitives_in_this_team),
[&](const int j) {
scratch_primitives(j) =
AccessPrimitives::get(primitives, primitive_start + j);
});
teamMember.team_barrier();

// start threads for every predicate / primitive combination
Expand Down

0 comments on commit 6aca3b8

Please sign in to comment.