Skip to content

Commit

Permalink
Change Indexables to operate on array-like Values
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Oct 24, 2023
1 parent 89f01f2 commit 6320774
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/ArborX_LinearBVH.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ BasicBoundingVolumeHierarchy<MemorySpace, Value, IndexableGetter,
return;
}

Details::Indexables<Values, IndexableGetter> indexables{user_values,
indexable_getter};
Details::Indexables<decltype(values), IndexableGetter> indexables{
values, indexable_getter};

Kokkos::Profiling::pushRegion(
"ArborX::BVH::BVH::calculate_scene_bounding_box");
Expand Down
7 changes: 3 additions & 4 deletions src/details/ArborX_IndexableGetter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,14 @@ struct Indexables
Values _values;
IndexableGetter _indexable_getter;

using Access = AccessTraits<Values, PrimitivesTag>;
using memory_space = typename Access::memory_space;
using memory_space = typename Values::memory_space;

KOKKOS_FUNCTION decltype(auto) operator()(int i) const
{
return _indexable_getter(Access::get(_values, i));
return _indexable_getter(_values(i));
}

KOKKOS_FUNCTION auto size() const { return Access::size(_values); }
KOKKOS_FUNCTION auto size() const { return _values.size(); }
};

} // namespace ArborX::Details
Expand Down

0 comments on commit 6320774

Please sign in to comment.