Skip to content

Commit 3c34dfb

Browse files
committed
Add compile-only test for bvh on custom type
1 parent ca28148 commit 3c34dfb

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

test/tstCompileOnlyTypeRequirements.cpp

+38
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,41 @@ void check_bounding_volume_and_predicate_geometry_type_requirements()
9191
KOKKOS_LAMBDA(NearestPredicate, auto){});
9292
#endif
9393
}
94+
95+
namespace Test
96+
{
97+
98+
// clang-format off
99+
struct FakePrimitiveGeometry {};
100+
101+
template <int DIM>
102+
KOKKOS_FUNCTION void expand(ArborX::Box<DIM> &, FakePrimitiveGeometry) {}
103+
KOKKOS_FUNCTION auto returnCentroid(FakePrimitiveGeometry) { return ArborX::Point<3>{}; }
104+
// clang-format on
105+
106+
} // namespace Test
107+
108+
template <>
109+
struct ArborX::GeometryTraits::dimension<Test::FakePrimitiveGeometry>
110+
{
111+
static constexpr int value = 3;
112+
};
113+
template <>
114+
struct ArborX::GeometryTraits::coordinate_type<Test::FakePrimitiveGeometry>
115+
{
116+
using type = float;
117+
};
118+
119+
// Compile-only
120+
void check_hierarchy_for_custom_types()
121+
{
122+
using ExecutionSpace = Kokkos::DefaultExecutionSpace;
123+
using MemorySpace = ExecutionSpace::memory_space;
124+
using Tree = ArborX::BoundingVolumeHierarchy<
125+
MemorySpace, Test::FakePrimitiveGeometry,
126+
ArborX::Experimental::DefaultIndexableGetter>;
127+
128+
Kokkos::View<Test::FakePrimitiveGeometry *, MemorySpace> primitives(
129+
"primitives", 0);
130+
Tree tree(ExecutionSpace{}, primitives);
131+
}

0 commit comments

Comments
 (0)