15 #ifndef BENCHMARK_RUNNER_H_
16 #define BENCHMARK_RUNNER_H_
21 #include "benchmark_api_internal.h"
22 #include "internal_macros.h"
23 #include "perf_counters.h"
24 #include "thread_manager.h"
28 BM_DECLARE_string(benchmark_min_time);
29 BM_DECLARE_double(benchmark_min_warmup_time);
30 BM_DECLARE_int32(benchmark_repetitions);
31 BM_DECLARE_bool(benchmark_report_aggregates_only);
32 BM_DECLARE_bool(benchmark_display_aggregates_only);
33 BM_DECLARE_string(benchmark_perf_counters);
37 extern MemoryManager* memory_manager;
38 extern ProfilerManager* profiler_manager;
41 std::vector<BenchmarkReporter::Run> non_aggregates;
42 std::vector<BenchmarkReporter::Run> aggregates_only;
44 bool display_report_aggregates_only =
false;
45 bool file_report_aggregates_only =
false;
49 enum { ITERS, TIME } tag;
65 int GetNumRepeats()
const {
return repeats; }
67 bool HasRepeatsRemaining()
const {
68 return GetNumRepeats() != num_repetitions_done;
71 void DoOneRepetition();
76 return reports_for_family;
79 double GetMinTime()
const {
return min_time; }
81 bool HasExplicitIters()
const {
return has_explicit_iteration_count; }
83 IterationCount GetIters()
const {
return iters; }
92 const double min_time;
93 const double min_warmup_time;
96 const bool has_explicit_iteration_count;
98 int num_repetitions_done = 0;
100 std::vector<std::thread> pool;
102 std::vector<MemoryManager::Result> memory_results;
104 IterationCount iters;
110 struct IterationResults {
112 IterationCount iters;
115 IterationResults DoNIterations();
119 void RunProfilerManager();
121 IterationCount PredictNumItersNeeded(
const IterationResults& i)
const;
123 bool ShouldReportIterationResults(
const IterationResults& i)
const;
125 double GetMinTimeToApply()
const;
127 void FinishWarmUp(
const IterationCount& i);
Definition: benchmark_api_internal.h:18
Definition: benchmark_runner.h:59
Definition: perf_counters.h:149
Definition: benchmark.h:1881
Definition: benchmark.h:382
Definition: benchmark_runner.h:48
Definition: benchmark_runner.h:40
Definition: thread_manager.h:39