-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename benchmarks/{dbscan => clustering} * Reorganize clustering benchmarks * Remove data converter * Instantiate data loader only once * benchmarks/clustering => benchmarks/cluster * Add missing copyright header * Maybe fix? * Address review comments * Fix else-after-return check
- Loading branch information
Showing
18 changed files
with
746 additions
and
961 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
add_library(cluster_benchmark_helpers | ||
data.cpp | ||
print_timers.cpp | ||
) | ||
target_link_libraries(cluster_benchmark_helpers PRIVATE ArborX::ArborX) | ||
|
||
set(input_file "input.txt") | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${input_file} ${CMAKE_CURRENT_BINARY_DIR}/${input_file} COPYONLY) | ||
|
||
add_executable(ArborX_Benchmark_DBSCAN.exe dbscan.cpp) | ||
target_include_directories(ArborX_Benchmark_DBSCAN.exe PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_link_libraries(ArborX_Benchmark_DBSCAN.exe ArborX::ArborX Boost::program_options cluster_benchmark_helpers) | ||
add_test(NAME ArborX_Benchmark_DBSCAN COMMAND ArborX_Benchmark_DBSCAN.exe --filename=${input_file} --eps=1.4 --verify) | ||
|
||
add_executable(ArborX_Benchmark_MST.exe mst.cpp) | ||
target_include_directories(ArborX_Benchmark_MST.exe PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_link_libraries(ArborX_Benchmark_MST.exe ArborX::ArborX Boost::program_options cluster_benchmark_helpers) | ||
add_test(NAME ArborX_Benchmark_HDBSCAN COMMAND ArborX_Benchmark_HDBSCAN.exe --filename=${input_file}) | ||
|
||
add_executable(ArborX_Benchmark_HDBSCAN.exe hdbscan.cpp) | ||
target_include_directories(ArborX_Benchmark_HDBSCAN.exe PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_link_libraries(ArborX_Benchmark_HDBSCAN.exe ArborX::ArborX Boost::program_options cluster_benchmark_helpers) | ||
add_test(NAME ArborX_Benchmark_MST COMMAND ArborX_Benchmark_MST.exe --filename=${input_file}) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/**************************************************************************** | ||
* Copyright (c) 2025, ArborX authors * | ||
* All rights reserved. * | ||
* * | ||
* This file is part of the ArborX library. ArborX is * | ||
* distributed under a BSD 3-clause license. For the licensing terms see * | ||
* the LICENSE file in the top-level directory. * | ||
* * | ||
* SPDX-License-Identifier: BSD-3-Clause * | ||
****************************************************************************/ | ||
#include "data.hpp" | ||
|
||
#include <Kokkos_Core.hpp> | ||
|
||
#include <fstream> | ||
#include <string> | ||
|
||
#include "data_timpl.hpp" | ||
|
||
namespace ArborXBenchmark | ||
{ | ||
|
||
// Explicit instantiations | ||
using MemorySpace = typename Kokkos::DefaultExecutionSpace::memory_space; | ||
#define INSTANTIATE_LOADER(DIM) \ | ||
template Kokkos::View<ArborX::Point<DIM> *, MemorySpace> \ | ||
loadData<DIM, MemorySpace>(ArborXBenchmark::Parameters const &); | ||
INSTANTIATE_LOADER(2) | ||
INSTANTIATE_LOADER(3) | ||
INSTANTIATE_LOADER(4) | ||
INSTANTIATE_LOADER(5) | ||
INSTANTIATE_LOADER(6) | ||
#undef INSTANTIATE_LOADER | ||
|
||
int getDataDimension(std::string const &filename, bool binary) | ||
{ | ||
std::ifstream input; | ||
if (!binary) | ||
input.open(filename); | ||
else | ||
input.open(filename, std::ifstream::binary); | ||
if (!input.good()) | ||
throw std::runtime_error("Error reading file \"" + filename + "\""); | ||
|
||
int num_points; | ||
int dim; | ||
if (!binary) | ||
{ | ||
input >> num_points; | ||
input >> dim; | ||
} | ||
else | ||
{ | ||
input.read(reinterpret_cast<char *>(&num_points), sizeof(int)); | ||
input.read(reinterpret_cast<char *>(&dim), sizeof(int)); | ||
} | ||
input.close(); | ||
|
||
return dim; | ||
} | ||
|
||
} // namespace ArborXBenchmark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/**************************************************************************** | ||
* Copyright (c) 2025, ArborX authors * | ||
* All rights reserved. * | ||
* * | ||
* This file is part of the ArborX library. ArborX is * | ||
* distributed under a BSD 3-clause license. For the licensing terms see * | ||
* the LICENSE file in the top-level directory. * | ||
* * | ||
* SPDX-License-Identifier: BSD-3-Clause * | ||
****************************************************************************/ | ||
#ifndef ARBORX_BENCHMARK_DATA_HPP | ||
#define ARBORX_BENCHMARK_DATA_HPP | ||
|
||
#include <ArborX_Point.hpp> | ||
|
||
#include <Kokkos_Core.hpp> | ||
|
||
#include "parameters.hpp" | ||
|
||
namespace ArborXBenchmark | ||
{ | ||
|
||
int getDataDimension(std::string const &filename, bool binary); | ||
|
||
template <int DIM, typename MemorySpace> | ||
Kokkos::View<ArborX::Point<DIM> *, MemorySpace> | ||
loadData(ArborXBenchmark::Parameters const ¶ms); | ||
|
||
} // namespace ArborXBenchmark | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.