From f3a0642e1161025bd880a61d94656b7ec99aee8f Mon Sep 17 00:00:00 2001 From: Matt Spraggs Date: Mon, 4 May 2015 13:24:03 +0100 Subject: [PATCH] Changed flops reporting to report total flops in benchmark helpers --- lib/benchmarks/helpers.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/benchmarks/helpers.hpp b/lib/benchmarks/helpers.hpp index 76431ef2..c69a937a 100644 --- a/lib/benchmarks/helpers.hpp +++ b/lib/benchmarks/helpers.hpp @@ -32,13 +32,13 @@ void benchmark(Fn func, const long num_flops = 0, const int num_trials = 100) auto end = std::chrono::system_clock::now(); std::chrono::duration elapsed_seconds = end - start; - double elapsed = elapsed_seconds.count() / num_trials; - std::cout << "Performed " << num_flops << " flops in " << elapsed + double elapsed = elapsed_seconds.count(); + std::cout << "Performed " << num_flops * num_trials << " flops in " << elapsed << " seconds"; if (num_flops > 0) { - std::cout << " => " << num_flops / elapsed / 1000000.0 << " Mflops." - << std::endl; + std::cout << " => " << num_trials * num_flops / elapsed / 1000000.0 + << " Mflops." << std::endl; } else { std::cout << "." << std::endl;