Skip to content

Commit

Permalink
Remove logging from benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ProExpertProg committed Nov 6, 2024
1 parent 0686cd6 commit d02d7a7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(google-benchmark)

add_executable(bench-naive naive.cpp)
target_link_libraries(bench-naive src-lib benchmark::benchmark_main)
add_executable(bench-naive naive.cpp main-no-log.cpp)
target_link_libraries(bench-naive src-lib benchmark::benchmark)

if (ENABLE_CILK)
add_executable(bench-fftw-cilk fftw-cilk.cpp)
Expand Down
14 changes: 14 additions & 0 deletions cpp/bench/main-no-log.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <benchmark/benchmark.h>
#include <spdlog/cfg/env.h>
#include <spdlog/spdlog.h>


int main(int argc, char **argv) {
// No logging in benchmarks (unless overridden via environment variable)
spdlog::set_level(spdlog::level::off);
spdlog::cfg::load_env_levels();

benchmark::Initialize(&argc, argv);
benchmark::RunSpecifiedBenchmarks();
benchmark::Shutdown();
}

0 comments on commit d02d7a7

Please sign in to comment.