blob: 0524a85c01d00180e2692a67ff2490a1b50e7e73 [file] [log] [blame]
Austin Schuhcbc17402019-01-21 21:00:30 -08001#ifndef BENCHMARK_API_INTERNAL_H
2#define BENCHMARK_API_INTERNAL_H
3
4#include "benchmark/benchmark.h"
5#include "commandlineflags.h"
6
7#include <cmath>
8#include <iosfwd>
9#include <limits>
10#include <memory>
11#include <string>
12#include <vector>
13
14namespace benchmark {
15namespace internal {
16
17// Information kept per benchmark we may want to run
18struct BenchmarkInstance {
19 std::string name;
20 Benchmark* benchmark;
21 AggregationReportMode aggregation_report_mode;
22 std::vector<int64_t> arg;
23 TimeUnit time_unit;
24 int range_multiplier;
25 bool use_real_time;
26 bool use_manual_time;
27 BigO complexity;
28 BigOFunc* complexity_lambda;
29 UserCounters counters;
30 const std::vector<Statistics>* statistics;
31 bool last_benchmark_instance;
32 int repetitions;
33 double min_time;
34 size_t iterations;
35 int threads; // Number of concurrent threads to us
36
37 State Run(size_t iters, int thread_id, internal::ThreadTimer* timer,
38 internal::ThreadManager* manager) const;
39};
40
41bool FindBenchmarksInternal(const std::string& re,
42 std::vector<BenchmarkInstance>* benchmarks,
43 std::ostream* Err);
44
45bool IsZero(double n);
46
47ConsoleReporter::OutputOptions GetOutputOptions(bool force_no_color = false);
48
49} // end namespace internal
50} // end namespace benchmark
51
52#endif // BENCHMARK_API_INTERNAL_H