Skip to content

Commit

Permalink
Rename predicate helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Feb 29, 2024
1 parent f6f24e1 commit 0d7579c
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion benchmarks/dbscan/ArborX_DBSCANVerification.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ bool verifyDBSCAN(ExecutionSpace exec_space, Primitives const &primitives,
bvh(exec_space, ArborX::Experimental::attach_indices(points));

auto const predicates = ArborX::Experimental::attach_indices(
ArborX::Experimental::intersect_geometries_with_radius(points, eps));
ArborX::Experimental::make_intersects(points, eps));

Kokkos::View<int *, MemorySpace> indices("ArborX::DBSCAN::indices", 0);
Kokkos::View<int *, MemorySpace> offset("ArborX::DBSCAN::offset", 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ int main_(std::vector<std::string> const &args, MPI_Comm const comm)
knn->start();
distributed_tree.query(
ExecutionSpace{},
ArborX::Experimental::nearest_k(random_queries, n_neighbors), values,
ArborX::Experimental::make_nearest(random_queries, n_neighbors), values,
offsets);
knn->stop();

Expand Down Expand Up @@ -413,9 +413,8 @@ int main_(std::vector<std::string> const &args, MPI_Comm const comm)
radius->start();
distributed_tree.query(
ExecutionSpace{},
ArborX::Experimental::intersect_geometries_with_radius(random_queries,
r),
values, offsets);
ArborX::Experimental::make_intersects(random_queries, r), values,
offsets);
radius->stop();

if (comm_rank == 0)
Expand Down
2 changes: 1 addition & 1 deletion examples/raytracing/example_raytracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ int main(int argc, char *argv[])
bvh.query(
exec_space,
ArborX::Experimental::attach_indices<int>(
ArborX::Experimental::intersect_geometries(rays)),
ArborX::Experimental::make_intersects(rays)),
IntersectsBased::AccumulateRaySphereIntersections<MemorySpace>{boxes},
values, offsets);

Expand Down
6 changes: 3 additions & 3 deletions src/ArborX_DBSCAN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ dbscan(ExecutionSpace const &exec_space, Primitives const &primitives,
else
{
auto const predicates = ArborX::Experimental::attach_indices(
ArborX::Experimental::intersect_geometries_with_radius(points, eps));
ArborX::Experimental::make_intersects(points, eps));

// Determine core points
Kokkos::Profiling::pushRegion("ArborX::DBSCAN::clusters::num_neigh");
Expand Down Expand Up @@ -407,7 +407,7 @@ dbscan(ExecutionSpace const &exec_space, Primitives const &primitives,
using CorePoints = Details::CCSCorePoints;
Kokkos::Profiling::pushRegion("ArborX::DBSCAN::clusters::query");
auto const predicates = Experimental::attach_indices(
Experimental::intersect_geometries_with_radius(points, eps));
Experimental::make_intersects(points, eps));
bvh.query(exec_space, predicates,
Details::FDBSCANDenseBoxCallback<UnionFind, CorePoints, Points,
decltype(dense_cell_offsets),
Expand Down Expand Up @@ -448,7 +448,7 @@ dbscan(ExecutionSpace const &exec_space, Primitives const &primitives,
// Perform the queries and build clusters through callback
Kokkos::Profiling::pushRegion("ArborX::DBSCAN::clusters::query");
auto const predicates = Experimental::attach_indices(
Experimental::intersect_geometries_with_radius(points, eps));
Experimental::make_intersects(points, eps));
bvh.query(exec_space, predicates,
Details::FDBSCANDenseBoxCallback<UnionFind, CorePoints, Points,
decltype(dense_cell_offsets),
Expand Down
2 changes: 1 addition & 1 deletion src/details/ArborX_MinimumSpanningTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct MinimumSpanningTree
"ArborX::MST::core_distances", n);
bvh.query(
space,
Experimental::attach_indices(Experimental::nearest_k(points, k)),
Experimental::attach_indices(Experimental::make_nearest(points, k)),
MaxDistance<Points, decltype(core_distances)>{points,
core_distances});
Kokkos::Profiling::popRegion();
Expand Down
7 changes: 3 additions & 4 deletions src/details/ArborX_PredicateHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,22 @@ class PrimitivesNearestK
};

template <typename Primitives>
auto intersect_geometries(Primitives const &primitives)
auto make_intersects(Primitives const &primitives)
{
Details::check_valid_access_traits(PrimitivesTag{}, primitives,
Details::DoNotCheckGetReturnType());
return PrimitivesIntersect<Primitives>{primitives};
}

template <typename Primitives, typename Coordinate>
auto intersect_geometries_with_radius(Primitives const &primitives,
Coordinate r)
auto make_intersects(Primitives const &primitives, Coordinate r)
{
Details::check_valid_access_traits(PrimitivesTag{}, primitives);
return PrimitivesWithRadius<Primitives>(primitives, r);
}

template <typename Primitives>
auto nearest_k(Primitives const &primitives, int k)
auto make_nearest(Primitives const &primitives, int k)
{
Details::check_valid_access_traits(PrimitivesTag{}, primitives,
Details::DoNotCheckGetReturnType());
Expand Down
2 changes: 1 addition & 1 deletion src/interpolation/ArborX_InterpMovingLeastSquares.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class MovingLeastSquares

// Create the predicates
auto predicates = Experimental::attach_indices(
Experimental::nearest_k(target_access, _num_neighbors));
Experimental::make_nearest(target_access, _num_neighbors));

// Create the callback
Kokkos::View<SourcePoint **, MemorySpace> source_view(
Expand Down
2 changes: 1 addition & 1 deletion test/tstDetailsMutualReachabilityDistance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ auto compute_core_distances(ExecutionSpace exec_space,
ArborX::Details::KokkosExt::ArithmeticTraits::infinity<float>::value;
Kokkos::deep_copy(exec_space, distances, -inf);
auto predicates = ArborX::Experimental::attach_indices(
ArborX::Experimental::nearest_k(points, k));
ArborX::Experimental::make_nearest(points, k));
bvh.query(exec_space, predicates,
ArborX::Details::MaxDistance<decltype(points), decltype(distances)>{
points, distances});
Expand Down
2 changes: 1 addition & 1 deletion test/tstNeighborList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ auto compute_reference(ExecutionSpace const &exec_space, Points const &points,
Kokkos::View<int *, ExecutionSpace> indices("Test::indices", 0);
ArborX::BoundingVolumeHierarchy<MemorySpace> bvh(exec_space, points);
auto predicates = ArborX::Experimental::attach_indices<int>(
ArborX::Experimental::intersect_geometries_with_radius(points, radius));
ArborX::Experimental::make_intersects(points, radius));
bvh.query(exec_space, predicates, Filter{}, indices, offsets);
ArborX::Details::expandHalfToFull(exec_space, offsets, indices);
return make_compressed_storage(
Expand Down
4 changes: 2 additions & 2 deletions test/tstQueryTreeRay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_ray_box_nearest, DeviceType,
ray, ArborX::Box{ArborX::Point{0, 0, 0}, ArborX::Point{1, 1, 1}}));

ARBORX_TEST_QUERY_TREE(exec_space, tree,
ArborX::Experimental::nearest_k(device_rays, 1),
ArborX::Experimental::make_nearest(device_rays, 1),
make_reference_solution<int>({0}, {0, 1}));
}

Expand All @@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_ray_box_intersection, DeviceType,
Kokkos::deep_copy(exec_space, device_rays, ray);

ARBORX_TEST_QUERY_TREE(
exec_space, tree, ArborX::Experimental::intersect_geometries(device_rays),
exec_space, tree, ArborX::Experimental::make_intersects(device_rays),
make_reference_solution<int>({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, {0, 10}));
}
BOOST_AUTO_TEST_SUITE_END()
Expand Down

0 comments on commit 0d7579c

Please sign in to comment.