Skip to content

Commit

Permalink
Move Indexable from Details to Experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Oct 12, 2024
1 parent c815ec7 commit 1389d25
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/cluster/ArborX_DBSCAN.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ dbscan(ExecutionSpace const &exec_space, Primitives const &primitives,
Box bounds;
Details::TreeConstruction::calculateBoundingBoxOfTheScene(
exec_space,
Details::Indexables<Points, Details::Indexable<Point>>{points, {}},
Details::Indexables<Points, Experimental::Indexable<Point>>{points, {}},
bounds);

// The cell length is chosen to be eps/sqrt(dimension), so that any two
Expand Down
5 changes: 3 additions & 2 deletions src/distributed/ArborX_DistributedTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class DistributedTreeBase
using BoundingVolume = typename BottomTree::bounding_volume_type;
using TopTree = BoundingVolumeHierarchy<
MemorySpace, PairValueIndex<BoundingVolume, int>,
Details::Indexable<PairValueIndex<BoundingVolume, int>>, BoundingVolume>;
Experimental::Indexable<PairValueIndex<BoundingVolume, int>>,
BoundingVolume>;

using bottom_tree_type = BottomTree;
using top_tree_type = TopTree;
Expand Down Expand Up @@ -119,7 +120,7 @@ class DistributedTreeBase
// NOTE: query() must be called as collective over all processes in the
// communicator passed to the constructor
template <typename MemorySpace, typename Value,
typename IndexableGetter = Details::Indexable<Value>,
typename IndexableGetter = Experimental::Indexable<Value>,
typename BoundingVolume = Box<
GeometryTraits::dimension_v<
std::decay_t<std::invoke_result_t<IndexableGetter, Value>>>,
Expand Down
2 changes: 1 addition & 1 deletion src/spatial/ArborX_BruteForce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace ArborX
{

template <typename MemorySpace, typename Value,
typename IndexableGetter = Details::Indexable<Value>,
typename IndexableGetter = Experimental::Indexable<Value>,
typename BoundingVolume = Box<
GeometryTraits::dimension_v<
std::decay_t<std::invoke_result_t<IndexableGetter, Value>>>,
Expand Down
4 changes: 2 additions & 2 deletions src/spatial/ArborX_LinearBVH.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct HappyTreeFriends;
} // namespace Details

template <typename MemorySpace, typename Value,
typename IndexableGetter = Details::Indexable<Value>,
typename IndexableGetter = Experimental::Indexable<Value>,
typename BoundingVolume = Box<
GeometryTraits::dimension_v<
std::decay_t<std::invoke_result_t<IndexableGetter, Value>>>,
Expand Down Expand Up @@ -179,7 +179,7 @@ KOKKOS_FUNCTION
typename Details::AccessValues<Values, PrimitivesTag>::value_type>;

template <typename MemorySpace, typename Value,
typename IndexableGetter = Details::Indexable<Value>,
typename IndexableGetter = Experimental::Indexable<Value>,
typename BoundingVolume = Box<
GeometryTraits::dimension_v<
std::decay_t<std::invoke_result_t<IndexableGetter, Value>>>,
Expand Down
14 changes: 12 additions & 2 deletions src/spatial/detail/ArborX_Indexable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
#include <detail/ArborX_AccessTraits.hpp>
#include <detail/ArborX_PairValueIndex.hpp>

namespace ArborX::Details
namespace ArborX
{

namespace Experimental
{

template <typename Value>
Expand Down Expand Up @@ -51,6 +54,11 @@ struct Indexable<PairValueIndex<Value, Index>>
}
};

} // namespace Experimental

namespace Details
{

template <typename Values, typename IndexableGetter>
struct Indexables
{
Expand All @@ -67,6 +75,8 @@ struct Indexables
KOKKOS_FUNCTION auto size() const { return _values.size(); }
};

} // namespace ArborX::Details
} // namespace Details

} // namespace ArborX

#endif
6 changes: 3 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ foreach(_test Callbacks Degenerate ManufacturedSolution ComparisonWithBoost)
"template <class MemorySpace>\n"
"using ArborX_Legacy_BVH_Box =\n"
" LegacyTree<ArborX::BoundingVolumeHierarchy<\n"
" MemorySpace, Value, ArborX::Details::Indexable<Value>, ArborX::Box<3, float>>>;\n"
" MemorySpace, Value, ArborX::Experimental::Indexable<Value>, ArborX::Box<3, float>>>;\n"
"#define ARBORX_TEST_TREE_TYPES Tuple<ArborX_Legacy_BVH_Box>\n"
"#define ARBORX_TEST_DEVICE_TYPES std::tuple<${ARBORX_DEVICE_TYPES}>\n"
"#include <tstQueryTree${_test}.cpp>\n"
Expand All @@ -106,7 +106,7 @@ foreach(_test Callbacks Degenerate ManufacturedSolution ComparisonWithBoost)
"template <class MemorySpace>\n"
"using ArborX_Legacy_BruteForce_Box =\n"
" LegacyTree<ArborX::BruteForce<\n"
" MemorySpace, Value, ArborX::Details::Indexable<Value>, ArborX::Box<3, float>>>;\n"
" MemorySpace, Value, ArborX::Experimental::Indexable<Value>, ArborX::Box<3, float>>>;\n"
"#define ARBORX_TEST_TREE_TYPES Tuple<ArborX_Legacy_BruteForce_Box>\n"
"#define ARBORX_TEST_DEVICE_TYPES std::tuple<${ARBORX_DEVICE_TYPES}>\n"
"#define ARBORX_TEST_DISABLE_CALLBACK_EARLY_EXIT\n"
Expand All @@ -130,7 +130,7 @@ foreach(_test Callbacks Degenerate ManufacturedSolution ComparisonWithBoost)
"template <class MemorySpace>\n"
"using ArborX_Legacy_BVH_${_bounding_volume} =\n"
" LegacyTree<ArborX::BoundingVolumeHierarchy<\n"
" MemorySpace, Value, ArborX::Details::Indexable<Value>, ${_bounding_volume}>>;\n"
" MemorySpace, Value, ArborX::Experimental::Indexable<Value>, ${_bounding_volume}>>;\n"
"#define ARBORX_TEST_TREE_TYPES Tuple<ArborX_Legacy_BVH_${_bounding_volume}>\n"
"#define ARBORX_TEST_DEVICE_TYPES std::tuple<${ARBORX_DEVICE_TYPES}>\n"
"#define ARBORX_TEST_DISABLE_NEAREST_QUERY\n"
Expand Down
2 changes: 1 addition & 1 deletion test/tstCompileOnlyTypeRequirements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void check_bounding_volume_and_predicate_geometry_type_requirements()
using MemorySpace = ExecutionSpace::memory_space;
using Tree = ArborX::BoundingVolumeHierarchy<
MemorySpace, Test::PrimitivePointOrBox,
ArborX::Details::Indexable<Test::PrimitivePointOrBox>,
ArborX::Experimental::Indexable<Test::PrimitivePointOrBox>,
Test::FakeBoundingVolume>;

Kokkos::View<Test::PrimitivePointOrBox *, MemorySpace> primitives(
Expand Down
4 changes: 2 additions & 2 deletions test/tstDetailsTreeConstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(assign_morton_codes, DeviceType,
using Values = LegacyValues<decltype(boxes), ArborX::Box<3>>;
Values values{boxes};
ArborX::Details::Indexables<
Values, ArborX::Details::Indexable<typename Values::value_type>>
Values, ArborX::Experimental::Indexable<typename Values::value_type>>
indexables{values, {}};

// Test for a bug where missing move ref operator() in default Indexable
Expand Down Expand Up @@ -174,7 +174,7 @@ void generateHierarchy(Primitives primitives, MortonCodes sorted_morton_codes,
BoundingVolume bounds;
ArborX::Details::TreeConstruction::generateHierarchy(
space, Values{primitives},
ArborX::Details::Indexable<typename Values::value_type>{},
ArborX::Experimental::Indexable<typename Values::value_type>{},
permutation_indices, sorted_morton_codes, leaf_nodes, internal_nodes,
bounds);
}
Expand Down
4 changes: 2 additions & 2 deletions test/tstIndexableGetter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(indexables, DeviceType, ARBORX_DEVICE_TYPES)
using Primitives = ArborX::Details::AccessValues<decltype(points_cloud),
ArborX::PrimitivesTag>;
using IndexableGetter =
ArborX::Details::Indexable<typename Primitives::value_type>;
ArborX::Experimental::Indexable<typename Primitives::value_type>;

Primitives primitives(points_cloud);

Expand All @@ -127,7 +127,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(indexables, DeviceType, ARBORX_DEVICE_TYPES)
using Primitives = ArborX::Details::AccessValues<decltype(points_cloud),
ArborX::PrimitivesTag>;
using IndexableGetter =
ArborX::Details::Indexable<typename Primitives::value_type>;
ArborX::Experimental::Indexable<typename Primitives::value_type>;
Primitives primitives(points_cloud);

ArborX::Details::Indexables<Primitives, IndexableGetter> indexables{
Expand Down

0 comments on commit 1389d25

Please sign in to comment.