Skip to content

Commit

Permalink
Switch most of benchmarks to APIv2
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Sep 25, 2024
1 parent a416c02 commit 79f734b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ struct CountCallback
{
Kokkos::View<int *, MemorySpace> _counts;

template <typename Query>
KOKKOS_FUNCTION void operator()(Query const &query, int) const
template <typename Query, typename Value>
KOKKOS_FUNCTION void operator()(Query const &query, Value const &) const
{
auto const i = ArborX::getData(query);
Kokkos::atomic_increment(&_counts(i));
Expand Down Expand Up @@ -184,17 +184,21 @@ int main(int argc, char *argv[])
InstanceManager<ExecutionSpace> instance_manager(num_exec_spaces);
auto const &instances = instance_manager.get_instances();

std::vector<ArborX::BVH<MemorySpace>> trees;
std::vector<ArborX::BoundingVolumeHierarchy<MemorySpace,
ArborX::PairValueIndex<Point>>>
trees;
for (int p = 0; p < num_problems; ++p)
{
auto const &exec_space = instances[p % num_exec_spaces];

trees.emplace_back(
exec_space, Kokkos::subview(primitives, Kokkos::pair<int, int>(
p * num_primitives,
(p + 1) * num_primitives)));
exec_space,
ArborX::Experimental::attach_indices(Kokkos::subview(
primitives, Kokkos::pair<int, int>(p * num_primitives,
(p + 1) * num_primitives))));
}
ArborX::BVH<MemorySpace> tree(instances[0], primitives);
ArborX::BoundingVolumeHierarchy<MemorySpace, ArborX::PairValueIndex<Point>>
tree(instances[0], ArborX::Experimental::attach_indices(primitives));

Kokkos::View<int *, MemorySpace> counts("Benchmark::counts",
num_predicates * num_problems);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ int main(int argc, char *argv[])
std::cout << "#triangles : " << triangles.size() << '\n';
std::cout << "#queries : " << random_points.size() << '\n';

ArborX::BVH<MemorySpace, Triangle> index(
ArborX::BoundingVolumeHierarchy<MemorySpace, Triangle> index(
space, Triangles<MemorySpace>{vertices, triangles});

Kokkos::View<int *, MemorySpace> offset("Benchmark::offsets", 0);
Expand Down

0 comments on commit 79f734b

Please sign in to comment.