Skip to content

Commit

Permalink
Relax requirements on type matching
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Apr 11, 2024
1 parent b257854 commit 92d5e96
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
5 changes: 2 additions & 3 deletions benchmarks/brute_force_vs_bvh/brute_force_vs_bvh_timpl.hpp
Expand Up @@ -93,8 +93,7 @@ static void run_fp(int nprimitives, int nqueries, int nrepeats)
ArborX::PairValueIndex<Point>>
bvh{space, ArborX::Experimental::attach_indices(primitives)};

Kokkos::View<unsigned *, ExecutionSpace> indices("Benchmark::indices_ref",
0);
Kokkos::View<int *, ExecutionSpace> indices("Benchmark::indices_ref", 0);
Kokkos::View<int *, ExecutionSpace> offset("Benchmark::offset_ref", 0);
bvh.query(space, predicates, indices, offset);

Expand All @@ -112,7 +111,7 @@ static void run_fp(int nprimitives, int nqueries, int nrepeats)
ArborX::BruteForce<MemorySpace, ArborX::PairValueIndex<Point>> brute{
space, ArborX::Experimental::attach_indices(primitives)};

Kokkos::View<unsigned *, ExecutionSpace> indices("Benchmark::indices", 0);
Kokkos::View<int *, ExecutionSpace> indices("Benchmark::indices", 0);
Kokkos::View<int *, ExecutionSpace> offset("Benchmark::offset", 0);
brute.query(space, predicates, indices, offset);

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dbscan/ArborX_DBSCANVerification.hpp
Expand Up @@ -317,7 +317,7 @@ bool verifyDBSCAN(ExecutionSpace exec_space, Primitives const &primitives,
auto const predicates = ArborX::Experimental::attach_indices(
ArborX::Experimental::make_intersects(points, eps));

Kokkos::View<unsigned *, MemorySpace> indices("ArborX::DBSCAN::indices", 0);
Kokkos::View<int *, MemorySpace> indices("ArborX::DBSCAN::indices", 0);
Kokkos::View<int *, MemorySpace> offset("ArborX::DBSCAN::offset", 0);
ArborX::query(bvh, exec_space, predicates, indices, offset);

Expand Down
4 changes: 2 additions & 2 deletions examples/simple_intersection/example_intersection.cpp
Expand Up @@ -50,8 +50,8 @@ int main(int argc, char *argv[])

ExecutionSpace space;

ArborX::BVH<MemorySpace, ArborX::PairValueIndex<Box, int>> const tree(
space, ArborX::Experimental::attach_indices<int>(boxes));
ArborX::BVH<MemorySpace, ArborX::PairValueIndex<Box>> const tree(
space, ArborX::Experimental::attach_indices(boxes));

// The query will resize indices and offsets accordingly
Kokkos::View<int *, MemorySpace> indices("Example::indices", 0);
Expand Down
6 changes: 2 additions & 4 deletions src/ArborX_BruteForce.hpp
Expand Up @@ -92,10 +92,8 @@ class BruteForce
else if constexpr (!Details::is_pair_value_index_v<value_type>)
return false;
else
{
return std::is_same_v<typename std::decay_t<CallbackOrView>::value_type,
typename value_type::index_type>;
}
return std::is_integral_v<
typename std::decay_t<CallbackOrView>::value_type>;
}();

if constexpr (use_convenient_shortcut)
Expand Down
6 changes: 2 additions & 4 deletions src/ArborX_LinearBVH.hpp
Expand Up @@ -116,10 +116,8 @@ class BoundingVolumeHierarchy
else if constexpr (!Details::is_pair_value_index_v<value_type>)
return false;
else
{
return std::is_same_v<typename std::decay_t<CallbackOrView>::value_type,
typename value_type::index_type>;
}
return std::is_integral_v<
typename std::decay_t<CallbackOrView>::value_type>;
}();

if constexpr (use_convenient_shortcut)
Expand Down

0 comments on commit 92d5e96

Please sign in to comment.