Skip to content

Commit

Permalink
Merge pull request #914 from aprokop/change_default_volume
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop authored Jul 24, 2023
2 parents 125b56d + 9ea09bb commit 244e49d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
3 changes: 1 addition & 2 deletions benchmarks/brute_force_vs_bvh/brute_force_vs_bvh_timpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ void ArborXBenchmark::run(int nprimitives, int nqueries, int nrepeats)
{
Kokkos::Timer timer;
ArborX::BasicBoundingVolumeHierarchy<
MemorySpace, ArborX::Details::PairIndexVolume<Box>,
ArborX::Details::DefaultIndexableGetter, Box>
MemorySpace, ArborX::Details::PairIndexVolume<Box>>
bvh{space, primitives};

Kokkos::View<int *, ExecutionSpace> indices("indices_ref", 0);
Expand Down
5 changes: 2 additions & 3 deletions benchmarks/dbscan/ArborX_DBSCANVerification.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,8 @@ bool verifyDBSCAN(ExecutionSpace exec_space, Primitives const &primitives,
constexpr int dim = GeometryTraits::dimension_v<
typename Details::AccessTraitsHelper<Access>::type>;
using Box = ExperimentalHyperGeometry::Box<dim>;
ArborX::BasicBoundingVolumeHierarchy<
MemorySpace, ArborX::Details::PairIndexVolume<Box>,
ArborX::Details::DefaultIndexableGetter, Box>
ArborX::BasicBoundingVolumeHierarchy<MemorySpace,
ArborX::Details::PairIndexVolume<Box>>
bvh(exec_space, primitives);

auto const predicates =
Expand Down
6 changes: 2 additions & 4 deletions src/ArborX_DBSCAN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ dbscan(ExecutionSpace const &exec_space, Primitives const &primitives,
// Build the tree
Kokkos::Profiling::pushRegion("ArborX::DBSCAN::tree_construction");
ArborX::BasicBoundingVolumeHierarchy<MemorySpace,
Details::PairIndexVolume<Box>,
Details::DefaultIndexableGetter, Box>
Details::PairIndexVolume<Box>>
bvh(exec_space, primitives);
Kokkos::Profiling::popRegion();

Expand Down Expand Up @@ -413,8 +412,7 @@ dbscan(ExecutionSpace const &exec_space, Primitives const &primitives,
// Build the tree
Kokkos::Profiling::pushRegion("ArborX::DBSCAN::tree_construction");
ArborX::BasicBoundingVolumeHierarchy<MemorySpace,
Details::PairIndexVolume<Box>,
Details::DefaultIndexableGetter, Box>
Details::PairIndexVolume<Box>>
bvh(exec_space,
Details::MixedBoxPrimitives<
Primitives, decltype(dense_cell_offsets),
Expand Down
17 changes: 10 additions & 7 deletions src/ArborX_LinearBVH.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ namespace Details
struct HappyTreeFriends;
} // namespace Details

template <typename MemorySpace, typename Value,
typename IndexableGetter = Details::DefaultIndexableGetter,
typename BoundingVolume = Box>
template <
typename MemorySpace, typename Value,
typename IndexableGetter = Details::DefaultIndexableGetter,
typename BoundingVolume =
ExperimentalHyperGeometry::Box<GeometryTraits::dimension_v<std::decay_t<
decltype(std::declval<IndexableGetter>()(std::declval<Value>()))>>>>
class BasicBoundingVolumeHierarchy
{
public:
Expand Down Expand Up @@ -88,6 +91,8 @@ class BasicBoundingVolumeHierarchy
private:
friend struct Details::HappyTreeFriends;

using indexable_type = std::decay_t<decltype(std::declval<IndexableGetter>()(
std::declval<Value>()))>;
using leaf_node_type = Details::LeafNode<value_type>;
using internal_node_type = Details::InternalNode<bounding_volume_type>;

Expand Down Expand Up @@ -186,8 +191,7 @@ BasicBoundingVolumeHierarchy<MemorySpace, Value, IndexableGetter,
if (size() == 1)
{
Details::TreeConstruction::initializeSingleLeafTree(
space,
Details::LegacyValues<Primitives, bounding_volume_type>{primitives},
space, Details::LegacyValues<Primitives, indexable_type>{primitives},
_indexable_getter, _leaf_nodes, _bounds);
return;
}
Expand Down Expand Up @@ -228,8 +232,7 @@ BasicBoundingVolumeHierarchy<MemorySpace, Value, IndexableGetter,

// Generate bounding volume hierarchy
Details::TreeConstruction::generateHierarchy(
space,
Details::LegacyValues<Primitives, bounding_volume_type>{primitives},
space, Details::LegacyValues<Primitives, indexable_type>{primitives},
_indexable_getter, permutation_indices, linear_ordering_indices,
_leaf_nodes, _internal_nodes, _bounds);

Expand Down
5 changes: 2 additions & 3 deletions src/details/ArborX_MinimumSpanningTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,9 +716,8 @@ struct MinimumSpanningTree
auto const n = AccessTraits<Primitives, PrimitivesTag>::size(primitives);

Kokkos::Profiling::pushRegion("ArborX::MST::construction");
BasicBoundingVolumeHierarchy<MemorySpace, PairIndexVolume<Box>,
DefaultIndexableGetter, Box>
bvh(space, primitives);
BasicBoundingVolumeHierarchy<MemorySpace, PairIndexVolume<Box>> bvh(
space, primitives);
Kokkos::Profiling::popRegion();

if (k > 1)
Expand Down

0 comments on commit 244e49d

Please sign in to comment.