From 0d7579c51bdbc46c07484f77d9c7034f6c4af2d0 Mon Sep 17 00:00:00 2001 From: Andrey Prokopenko Date: Thu, 29 Feb 2024 14:56:26 -0500 Subject: [PATCH] Rename predicate helpers --- benchmarks/dbscan/ArborX_DBSCANVerification.hpp | 2 +- .../distributed_tree_driver/distributed_tree_driver.cpp | 7 +++---- examples/raytracing/example_raytracing.cpp | 2 +- src/ArborX_DBSCAN.hpp | 6 +++--- src/details/ArborX_MinimumSpanningTree.hpp | 2 +- src/details/ArborX_PredicateHelpers.hpp | 7 +++---- src/interpolation/ArborX_InterpMovingLeastSquares.hpp | 2 +- test/tstDetailsMutualReachabilityDistance.cpp | 2 +- test/tstNeighborList.cpp | 2 +- test/tstQueryTreeRay.cpp | 4 ++-- 10 files changed, 17 insertions(+), 19 deletions(-) diff --git a/benchmarks/dbscan/ArborX_DBSCANVerification.hpp b/benchmarks/dbscan/ArborX_DBSCANVerification.hpp index 6395e1c75..42dfbca4e 100644 --- a/benchmarks/dbscan/ArborX_DBSCANVerification.hpp +++ b/benchmarks/dbscan/ArborX_DBSCANVerification.hpp @@ -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 indices("ArborX::DBSCAN::indices", 0); Kokkos::View offset("ArborX::DBSCAN::offset", 0); diff --git a/benchmarks/distributed_tree_driver/distributed_tree_driver.cpp b/benchmarks/distributed_tree_driver/distributed_tree_driver.cpp index c66ad4878..54f2de3f7 100644 --- a/benchmarks/distributed_tree_driver/distributed_tree_driver.cpp +++ b/benchmarks/distributed_tree_driver/distributed_tree_driver.cpp @@ -375,7 +375,7 @@ int main_(std::vector 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(); @@ -413,9 +413,8 @@ int main_(std::vector 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) diff --git a/examples/raytracing/example_raytracing.cpp b/examples/raytracing/example_raytracing.cpp index 162a9a7e7..d0b302203 100644 --- a/examples/raytracing/example_raytracing.cpp +++ b/examples/raytracing/example_raytracing.cpp @@ -311,7 +311,7 @@ int main(int argc, char *argv[]) bvh.query( exec_space, ArborX::Experimental::attach_indices( - ArborX::Experimental::intersect_geometries(rays)), + ArborX::Experimental::make_intersects(rays)), IntersectsBased::AccumulateRaySphereIntersections{boxes}, values, offsets); diff --git a/src/ArborX_DBSCAN.hpp b/src/ArborX_DBSCAN.hpp index de24c555a..169c52f50 100644 --- a/src/ArborX_DBSCAN.hpp +++ b/src/ArborX_DBSCAN.hpp @@ -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"); @@ -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{points, core_distances}); Kokkos::Profiling::popRegion(); diff --git a/src/details/ArborX_PredicateHelpers.hpp b/src/details/ArborX_PredicateHelpers.hpp index a012ee814..200b911ed 100644 --- a/src/details/ArborX_PredicateHelpers.hpp +++ b/src/details/ArborX_PredicateHelpers.hpp @@ -65,7 +65,7 @@ class PrimitivesNearestK }; template -auto intersect_geometries(Primitives const &primitives) +auto make_intersects(Primitives const &primitives) { Details::check_valid_access_traits(PrimitivesTag{}, primitives, Details::DoNotCheckGetReturnType()); @@ -73,15 +73,14 @@ auto intersect_geometries(Primitives const &primitives) } template -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, r); } template -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()); diff --git a/src/interpolation/ArborX_InterpMovingLeastSquares.hpp b/src/interpolation/ArborX_InterpMovingLeastSquares.hpp index 08d2efe42..f05fd1c52 100644 --- a/src/interpolation/ArborX_InterpMovingLeastSquares.hpp +++ b/src/interpolation/ArborX_InterpMovingLeastSquares.hpp @@ -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 source_view( diff --git a/test/tstDetailsMutualReachabilityDistance.cpp b/test/tstDetailsMutualReachabilityDistance.cpp index 15d6680b1..879e5b6b3 100644 --- a/test/tstDetailsMutualReachabilityDistance.cpp +++ b/test/tstDetailsMutualReachabilityDistance.cpp @@ -42,7 +42,7 @@ auto compute_core_distances(ExecutionSpace exec_space, ArborX::Details::KokkosExt::ArithmeticTraits::infinity::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{ points, distances}); diff --git a/test/tstNeighborList.cpp b/test/tstNeighborList.cpp index 0a9ab368a..76a82947d 100644 --- a/test/tstNeighborList.cpp +++ b/test/tstNeighborList.cpp @@ -54,7 +54,7 @@ auto compute_reference(ExecutionSpace const &exec_space, Points const &points, Kokkos::View indices("Test::indices", 0); ArborX::BoundingVolumeHierarchy bvh(exec_space, points); auto predicates = ArborX::Experimental::attach_indices( - 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( diff --git a/test/tstQueryTreeRay.cpp b/test/tstQueryTreeRay.cpp index c8bb01b1b..7faffeddd 100644 --- a/test/tstQueryTreeRay.cpp +++ b/test/tstQueryTreeRay.cpp @@ -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({0}, {0, 1})); } @@ -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({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, {0, 10})); } BOOST_AUTO_TEST_SUITE_END()