diff --git a/src/spatial/detail/ArborX_IndexableGetter.hpp b/src/spatial/detail/ArborX_IndexableGetter.hpp index 9a660abcf..17067ad85 100644 --- a/src/spatial/detail/ArborX_IndexableGetter.hpp +++ b/src/spatial/detail/ArborX_IndexableGetter.hpp @@ -27,29 +27,30 @@ struct DefaultIndexableGetter KOKKOS_DEFAULTED_FUNCTION DefaultIndexableGetter() = default; - template >> + template KOKKOS_FUNCTION auto const &operator()(Geometry const &geometry) const { return geometry; } - template >> + template >>> KOKKOS_FUNCTION auto operator()(Geometry &&geometry) const { return geometry; } - template - KOKKOS_FUNCTION Value const & - operator()(PairValueIndex const &pair) const + template + KOKKOS_FUNCTION Geometry const & + operator()(PairValueIndex const &pair) const { return pair.value; } - template - KOKKOS_FUNCTION Value operator()(PairValueIndex &&pair) const + template + KOKKOS_FUNCTION Geometry + operator()(PairValueIndex &&pair) const { return pair.value; } diff --git a/src/spatial/detail/ArborX_PairValueIndex.hpp b/src/spatial/detail/ArborX_PairValueIndex.hpp index 22ab2899c..13e244ff5 100644 --- a/src/spatial/detail/ArborX_PairValueIndex.hpp +++ b/src/spatial/detail/ArborX_PairValueIndex.hpp @@ -31,6 +31,21 @@ struct PairValueIndex Index index; }; +namespace Details +{ +template +struct is_pair_value_index : public std::false_type +{}; + +template +struct is_pair_value_index> : public std::true_type +{}; + +template +inline constexpr bool is_pair_value_index_v = is_pair_value_index::value; + +} // namespace Details + } // namespace ArborX #endif diff --git a/test/tstCompileOnlyTypeRequirements.cpp b/test/tstCompileOnlyTypeRequirements.cpp index 205da644f..35e0375c7 100644 --- a/test/tstCompileOnlyTypeRequirements.cpp +++ b/test/tstCompileOnlyTypeRequirements.cpp @@ -91,3 +91,37 @@ void check_bounding_volume_and_predicate_geometry_type_requirements() KOKKOS_LAMBDA(NearestPredicate, auto){}); #endif } + +namespace Test +{ + +// clang-format off +struct FakePrimitiveGeometry {}; + +KOKKOS_FUNCTION void expand(ArborX::Box<3> &, FakePrimitiveGeometry) {} +KOKKOS_FUNCTION ArborX::Point<3> returnCentroid(FakePrimitiveGeometry) { return {}; } +// clang-format on + +} // namespace Test + +template <> +struct ArborX::GeometryTraits::dimension +{ + static constexpr int value = 3; +}; +template <> +struct ArborX::GeometryTraits::coordinate_type +{ + using type = float; +}; + +// Compile-only +void check_hierarchy_for_custom_types() +{ + using ExecutionSpace = Kokkos::DefaultExecutionSpace; + using MemorySpace = ExecutionSpace::memory_space; + + Kokkos::View primitives( + "primitives", 0); + ArborX::BoundingVolumeHierarchy tree(ExecutionSpace{}, primitives); +}