-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
9dbbd76
commit 064af34
Showing
34 changed files
with
724 additions
and
97,571 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
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
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 |
---|---|---|
@@ -1,42 +1,45 @@ | ||
macro(DISSOLVE_BENCHMARK NAME) | ||
set(benchmark_files ${benchmark_files} ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}/${NAME}_benchmark.cpp) | ||
endmacro(DISSOLVE_BENCHMARK) | ||
|
||
dissolve_benchmark(calculate_gr) | ||
dissolve_benchmark(box) | ||
dissolve_benchmark(histogram) | ||
dissolve_benchmark(array) | ||
dissolve_benchmark(energy) | ||
dissolve_benchmark(forces) | ||
dissolve_benchmark(region) | ||
dissolve_benchmark(math) | ||
dissolve_benchmark(siterdf) | ||
|
||
# create a single benchmark executable | ||
add_executable(benchmarks benchmarks.cpp ${benchmark_files}) | ||
|
||
target_include_directories(benchmarks PRIVATE ${PROJECT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
target_link_libraries( | ||
benchmarks | ||
PRIVATE benchmark::benchmark | ||
PUBLIC ${WHOLE_ARCHIVE_FLAG} ${BASIC_LINK_LIBS} ${MODULENOGUI_LINK_LIBS} ${NO_WHOLE_ARCHIVE_FLAG} | ||
PRIVATE ${CORE_LINK_LIBS} ${THREADING_LINK_LIBS} | ||
) | ||
|
||
target_compile_options(benchmarks PRIVATE -O3) | ||
|
||
# Find all the input files | ||
file( | ||
GLOB benchmarkFiles | ||
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/benchmark_files/*.txt" | ||
) | ||
|
||
# configure the input header to point to the directory containing the benchmark | ||
set(BENCHMARK_PATH \"${CMAKE_CURRENT_BINARY_DIR}/\") | ||
configure_file(benchmark_config.h.in benchmark_config.h @ONLY) | ||
|
||
foreach(benchmarkFile ${benchmarkFiles}) | ||
file(COPY ${benchmarkFile} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) | ||
endforeach(benchmarkFile) | ||
# CMakeLists.txt for Dissolve Benchmarks | ||
|
||
function(dissolve_add_benchmark) | ||
|
||
# Parse arguments | ||
set(options "") | ||
set(oneValueArgs SRC "") | ||
cmake_parse_arguments(DISSOLVE_BENCHMARK "${options}" "${oneValueArgs}" "" ${ARGN}) | ||
|
||
# Check args | ||
if(NOT DEFINED DISSOLVE_BENCHMARK_SRC) | ||
message(FATAL_ERROR "Benchmark registered from directory '${CMAKE_CURRENT_LIST_DIR}' did not set a SRC file.") | ||
endif(NOT DEFINED DISSOLVE_BENCHMARK_SRC) | ||
|
||
# Strip path and extension from source file to get benchmark name | ||
get_filename_component(benchmark_file ${DISSOLVE_BENCHMARK_SRC} NAME_WE) | ||
get_filename_component(benchmark_file_dir "${CMAKE_CURRENT_LIST_DIR}" NAME) | ||
set(BENCHMARK_NAME "benchmark_${benchmark_file_dir}_${benchmark_file}") | ||
message(STATUS "... Benchmark '${BENCHMARK_NAME}' from ${DISSOLVE_BENCHMARK_SRC} in directory '${CMAKE_CURRENT_LIST_DIR}'") | ||
message(STATUS " ... working directory = ${DISSOLVE_BENCHMARK_USE_TEST_DIRECTORY}") | ||
|
||
# Register executable target | ||
add_executable(${BENCHMARK_NAME} ${DISSOLVE_BENCHMARK_SRC}) | ||
target_compile_options(${BENCHMARK_NAME} PRIVATE -O3) | ||
|
||
# Configure target | ||
target_include_directories( | ||
${BENCHMARK_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} | ||
${PROJECT_SOURCE_DIR}/benchmark ${PROJECT_BINARY_DIR}/benchmark ${CONAN_INCLUDE_DIRS_PUGIXML} | ||
) | ||
target_link_libraries( | ||
${BENCHMARK_NAME} | ||
PUBLIC ${WHOLE_ARCHIVE_FLAG} ${BASIC_LINK_LIBS} ${MODULENOGUI_LINK_LIBS} ${NO_WHOLE_ARCHIVE_FLAG} | ||
PRIVATE ${CORE_LINK_LIBS} benchmark::benchmark | ||
) | ||
|
||
endfunction() | ||
|
||
set(DISSOLVE_BENCHMARK_INPUT_FILE_PATH \"${PROJECT_SOURCE_DIR}/benchmark/common/\") | ||
configure_file(benchmarkConfig.h.in benchmarkConfig.h @ONLY) | ||
|
||
# Add benchmark subdirectories | ||
add_subdirectory(classes) | ||
add_subdirectory(math) | ||
add_subdirectory(modules) |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.