From f3e66e63a7da3ebb99fb9d9c7653e94c7bf23236 Mon Sep 17 00:00:00 2001 From: Andrey Prokopenko Date: Fri, 19 Jul 2024 15:28:37 -0400 Subject: [PATCH] Address some review comments --- .../custom_distance/example_custom_distance.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/custom_distance/example_custom_distance.cpp b/examples/custom_distance/example_custom_distance.cpp index b4ac58460..bc63413cb 100644 --- a/examples/custom_distance/example_custom_distance.cpp +++ b/examples/custom_distance/example_custom_distance.cpp @@ -28,7 +28,7 @@ struct CustomPoint : public Point // Provide the required centroid function for the custom data type KOKKOS_FUNCTION auto returnCentroid(CustomPoint const &point) { - return Kokkos::bit_cast(point); + return static_cast(point); } // Provide the distance function between indexable getter geometry and the @@ -77,7 +77,7 @@ struct ArborX::AccessTraits, ArborX::PredicatesTag> }; // Callback to store the resulting distances -struct DistanceCallback +struct ComputeDistance { template KOKKOS_FUNCTION void operator()(Query const &query, Value const &value, @@ -99,10 +99,11 @@ int main(int argc, char *argv[]) // In L2 metric, two bottom points are the closest. // In custom metric, left two points are the closest. // - // x - // - // o - // x x + // | 2 + // | + // | x + // | 0 1 + // +----------- Kokkos::View points("Example::points", 3); auto points_host = Kokkos::create_mirror_view(points); points_host[0] = {0, 0}; @@ -120,7 +121,7 @@ int main(int argc, char *argv[]) Kokkos::View distances("Example::distances", 0); Kokkos::View offsets("Example::offsets", 0); bvh.query(space, CustomPoints{query_points}, - DistanceCallback{}, distances, offsets); + ComputeDistance{}, distances, offsets); auto offsets_host = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace{}, offsets);