Skip to content

Commit

Permalink
Reenable clustering tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Jul 24, 2023
1 parent 59d8ae8 commit be54657
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
24 changes: 12 additions & 12 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ target_compile_definitions(ArborX_Test_DetailsCrsGraphWrapperImpl.exe PRIVATE BO
target_include_directories(ArborX_Test_DetailsCrsGraphWrapperImpl.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME ArborX_Test_DetailsCrsGraphWrapperImpl COMMAND ArborX_Test_DetailsCrsGraphWrapperImpl.exe)

# add_executable(ArborX_Test_Clustering.exe
# tstDBSCAN.cpp
# tstDendrogram.cpp
# utf_main.cpp
# )
# target_link_libraries(ArborX_Test_Clustering.exe PRIVATE ArborX Boost::unit_test_framework)
# target_compile_definitions(ArborX_Test_Clustering.exe PRIVATE BOOST_TEST_DYN_LINK)
# target_include_directories(ArborX_Test_Clustering.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/benchmarks/dbscan)
# add_test(NAME ArborX_Test_Clustering COMMAND ArborX_Test_Clustering.exe)
add_executable(ArborX_Test_Clustering.exe
tstDBSCAN.cpp
tstDendrogram.cpp
utf_main.cpp
)
target_link_libraries(ArborX_Test_Clustering.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_Clustering.exe PRIVATE BOOST_TEST_DYN_LINK)
target_include_directories(ArborX_Test_Clustering.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/benchmarks/dbscan)
add_test(NAME ArborX_Test_Clustering COMMAND ArborX_Test_Clustering.exe)

# compare results with a dataset of 1000 points from mlpack
configure_file(
Expand All @@ -189,9 +189,9 @@ configure_file(
)
add_executable(ArborX_Test_DetailsClusteringHelpers.exe
tstDetailsTreeNodeLabeling.cpp
# tstDetailsMutualReachabilityDistance.cpp
# tstMinimumSpanningTree.cpp
# tstMinimumSpanningTreeGoldenTest.cpp
tstDetailsMutualReachabilityDistance.cpp
tstMinimumSpanningTree.cpp
tstMinimumSpanningTreeGoldenTest.cpp
tstUnionFind.cpp
utf_main.cpp
)
Expand Down
15 changes: 6 additions & 9 deletions test/tstDetailsMutualReachabilityDistance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,17 @@ namespace Test
using ArborXTest::toView;

template <class ExecutionSpace>
auto compute_core_distances(
ExecutionSpace exec_space,
std::vector<ArborX::Details::PairIndexVolume<ArborX::Point>> const
&points_host,
int k)
auto compute_core_distances(ExecutionSpace exec_space,
std::vector<ArborX::Point> const &points_host,
int k)
{
auto points = toView<ExecutionSpace>(points_host, "Test::points");

ARBORX_ASSERT(points.extent_int(0) >= k);
using MemorySpace = typename ExecutionSpace::memory_space;
ArborX::BasicBoundingVolumeHierarchy<
MemorySpace, ArborX::Details::PairIndexVolume<ArborX::Point>>
bvh{exec_space, points};
bvh{exec_space, ArborX::Details::LegacyValues{points, ArborX::Point{}}};
Kokkos::View<float *, MemorySpace> distances(
Kokkos::view_alloc(Kokkos::WithoutInitializing, "Test::core_distances"),
bvh.size());
Expand Down Expand Up @@ -100,9 +98,8 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(compute_core_distances, DeviceType,
using ExecutionSpace = typename DeviceType::execution_space;
ExecutionSpace exec_space;

std::vector<ArborX::Details::PairIndexVolume<Point>> points{
{0, {0, 0, 0}}, {1, {1, 0, 0}}, {2, {2, 0, 0}},
{3, {3, 0, 0}}, {4, {4, 0, 0}},
std::vector<ArborX::Point> points{
{0, 0, 0}, {1, 0, 0}, {2, 0, 0}, {3, 0, 0}, {4, 0, 0},
};
ARBORX_TEST_COMPUTE_CORE_DISTANCES(exec_space, points, 1,
(std::vector<float>{0, 0, 0, 0, 0}));
Expand Down

0 comments on commit be54657

Please sign in to comment.