Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove applyPermutation from the BatchedQueries #1179

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading