-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reorganize benchmarks/dbscan #1217
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3be019d
Rename benchmarks/{dbscan => clustering}
aprokop 10478a7
Reorganize clustering benchmarks
aprokop 981385a
Remove data converter
aprokop 1efd45f
Instantiate data loader only once
aprokop 26c4b14
benchmarks/clustering => benchmarks/cluster
aprokop 5be718d
Add missing copyright header
aprokop 8db9fc0
Maybe fix?
aprokop eddfdef
Address review comments
aprokop be87716
Fix else-after-return check
aprokop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) | ||
aprokop marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
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" | ||
|
||
aprokop marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't really matter for the executable. We don't do this anywhere else.