From 94e91203b2c2bd9ab10f10b8dddcc648b4db8f01 Mon Sep 17 00:00:00 2001 From: Andrey Prokopenko Date: Mon, 23 Oct 2023 09:22:46 -0400 Subject: [PATCH] Address minor comments --- src/details/ArborX_MinimumSpanningTree.hpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/details/ArborX_MinimumSpanningTree.hpp b/src/details/ArborX_MinimumSpanningTree.hpp index 0184bbe02f..3d753468a5 100644 --- a/src/details/ArborX_MinimumSpanningTree.hpp +++ b/src/details/ArborX_MinimumSpanningTree.hpp @@ -25,6 +25,12 @@ #include #include +#if KOKKOS_VERSION >= 40200 +#include // KOKKOS_ASSERT +#else +#include // KOKKOS_ASSERT +#endif + #include // isfinite, signbit #if KOKKOS_VERSION >= 40100 @@ -570,7 +576,7 @@ void computeParents(ExecutionSpace const &space, Edges const &edges, using MemorySpace = typename SidedParents::memory_space; - auto num_edges = edges.size(); + int num_edges = edges.size(); // Encode both a sided parent and an edge weight into long long. // This way, once we sort based on this value, edges with the same sided @@ -619,8 +625,8 @@ void computeParents(ExecutionSpace const &space, Edges const &edges, // signbit instead of >= 0 just as an extra precaution against negative // floating zeros. static_assert(sizeof(int) == sizeof(float)); - assert(Kokkos::isfinite(edge.weight) && - Kokkos::signbit(edge.weight) == 0); + KOKKOS_ASSERT(Kokkos::isfinite(edge.weight) && + Kokkos::signbit(edge.weight) == 0); keys(e) = (key << shift) + KokkosExt::bit_cast(edge.weight); }); @@ -660,7 +666,7 @@ void computeParents(ExecutionSpace const &space, Edges const &edges, // Find the index of the smallest edge with the same weight in // this chain int m = i; - for (int k = i + 1; k < (int)num_edges && keys(k) == key; ++k) + for (int k = i + 1; k < num_edges && keys(k) == key; ++k) if (edges(permute(k)) < edges(permute(m))) m = k; @@ -675,7 +681,7 @@ void computeParents(ExecutionSpace const &space, Edges const &edges, Kokkos::RangePolicy(space, 0, num_edges), KOKKOS_LAMBDA(int const i) { int e = permute(i); - if (i == (int)num_edges - 1) + if (i == num_edges - 1) { // The parent of the root node is set to -1 parents(e) = -1;