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

Implement occupancy for self-collision #815

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
23 changes: 19 additions & 4 deletions src/details/ArborX_DetailsHalfTraversal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
#ifndef ARBORX_DETAILS_HALF_TRAVERSAL_HPP
#define ARBORX_DETAILS_HALF_TRAVERSAL_HPP

#include <ArborX_Callbacks.hpp> // LegacyCallbackWrapper
#include <ArborX_DetailsHappyTreeFriends.hpp>
#include <ArborX_DetailsLegacy.hpp>
#include <ArborX_DetailsNode.hpp> // ROPE_SENTINEL

#include <Kokkos_Core.hpp>

#include <cstdlib>

namespace ArborX::Details
{

Expand Down Expand Up @@ -46,9 +47,23 @@ struct HalfTraversal
}
else
{
Kokkos::parallel_for(
"ArborX::Experimental::HalfTraversal",
Kokkos::RangePolicy<ExecutionSpace>(space, 0, _bvh.size()), *this);
#if defined(KOKKOS_ENABLE_CUDA)
// While DesiredOccupancy option is only implemented for Cuda and is
// no-op for other backends, we don't want a surprise in the future once
// it's implemented for HIP. It is also unclear at this point what HIP
// value is going to be.
if constexpr (std::is_same_v<ExecutionSpace, Kokkos::Cuda>)
Kokkos::parallel_for(
"ArborX::Experimental::HalfTraversal",
Kokkos::Experimental::prefer(
Kokkos::RangePolicy<ExecutionSpace>(space, 0, _bvh.size()),
Kokkos::Experimental::DesiredOccupancy{Kokkos::AUTO}),
*this);
else
#endif
Kokkos::parallel_for(
"ArborX::Experimental::HalfTraversal",
Kokkos::RangePolicy<ExecutionSpace>(space, 0, _bvh.size()), *this);
}
}

Expand Down
Loading