15 #include "benchmark/benchmark.h"
35 : output_stream_(&
std::cout), error_stream_(&
std::cerr) {}
47 Out <<
"Running " <<
context.executable_name <<
"\n";
50 Out <<
"Run on (" << info.
num_cpus <<
" X "
52 << ((info.
num_cpus > 1) ?
"s" :
"") <<
")\n";
53 if (info.
caches.size() != 0) {
54 Out <<
"CPU Caches:\n";
55 for (
auto &CInfo : info.
caches) {
56 Out <<
" L" << CInfo.level <<
" " << CInfo.type <<
" "
57 << (CInfo.size / 1024) <<
" KiB";
58 if (CInfo.num_sharing != 0)
59 Out <<
" (x" << (info.
num_cpus / CInfo.num_sharing) <<
")";
64 Out <<
"Load Average: ";
67 if (It != info.
load_avg.end()) Out <<
", ";
74 Out << kv.first <<
": " << kv.second <<
"\n";
78 if (CPUInfo::Scaling::ENABLED == info.
scaling) {
79 Out <<
"***WARNING*** CPU scaling is enabled, the benchmark "
80 "real time measurements may be noisy and will incur extra "
85 Out <<
"***WARNING*** Library was built as DEBUG. Timings may be "
98 if (run_type == RT_Aggregate) {
99 name +=
"_" + aggregate_name;
106 if (iterations != 0) new_time /=
static_cast<double>(iterations);
112 if (iterations != 0) new_time /=
static_cast<double>(iterations);