Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use TeamVectorRange for filling tiles in BruteForce implementation #616

Merged
merged 1 commit into from
Jan 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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