Skip to content

Commit

Permalink
Changed flops reporting to report total flops in benchmark helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
mspraggs committed May 4, 2015
1 parent 2d29cca commit f3a0642
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/benchmarks/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double> 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;
Expand Down

0 comments on commit f3a0642

Please sign in to comment.