Skip to content

Commit

Permalink
Remove applyPermutation from the BatchedQueries
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Oct 10, 2024
1 parent 0975b50 commit 6971baf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
3 changes: 1 addition & 2 deletions examples/viz/tree_visualization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ void viz(std::string const &prefix, std::string const &infile, int n_neighbors)
sortPredicatesAlongSpaceFillingCurve(ExecutionSpace{},
ArborX::Experimental::Morton32(),
bvh.bounds(), queries);
queries = ArborX::Details::BatchedQueries<DeviceType>::applyPermutation(
ExecutionSpace{}, permute, queries);
ArborX::Details::applyPermutation(ExecutionSpace{}, permute, queries);
performQueries(prefix + "sorted_", suffix);
}

Expand Down
25 changes: 0 additions & 25 deletions src/spatial/detail/ArborX_BatchedQueries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,6 @@ struct BatchedQueries

return sortObjects(space, linear_ordering_indices);
}

// NOTE trailing return type seems required :(
// error: The enclosing parent function ("applyPermutation") for an extended
// __host__ __device__ lambda must not have deduced return type
template <typename ExecutionSpace, typename Predicates>
static auto
applyPermutation(ExecutionSpace const &space,
Kokkos::View<unsigned int const *, DeviceType> permute,
Predicates const &v)
-> Kokkos::View<typename Predicates::value_type *, DeviceType>
{
auto const n = v.size();
ARBORX_ASSERT(permute.extent(0) == n);

Kokkos::View<typename Predicates::value_type *, DeviceType> w(
Kokkos::view_alloc(space, Kokkos::WithoutInitializing,
"ArborX::permuted_predicates"),
n);
Kokkos::parallel_for(
"ArborX::BatchedQueries::permute_entries",
Kokkos::RangePolicy(space, 0, n),
KOKKOS_LAMBDA(int i) { w(i) = v(permute(i)); });

return w;
}
};

} // namespace ArborX::Details
Expand Down

0 comments on commit 6971baf

Please sign in to comment.