diff options
| author | chai <chaifix@163.com> | 2021-12-01 13:34:22 +0800 |
|---|---|---|
| committer | chai <chaifix@163.com> | 2021-12-01 13:34:22 +0800 |
| commit | 09abf1b529b4226f585ecfbb20866715b901755b (patch) | |
| tree | 16929f2a6bee3ad4667bdd006cfcc1e683ab7210 /Client/ThirdParty/fpm/3rdparty/googlebench/src/benchmark_register.h | |
| parent | 84d961f754c905b37420f4d1b3fee8f4e523e58a (diff) | |
+fpm
Diffstat (limited to 'Client/ThirdParty/fpm/3rdparty/googlebench/src/benchmark_register.h')
| -rw-r--r-- | Client/ThirdParty/fpm/3rdparty/googlebench/src/benchmark_register.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Client/ThirdParty/fpm/3rdparty/googlebench/src/benchmark_register.h b/Client/ThirdParty/fpm/3rdparty/googlebench/src/benchmark_register.h new file mode 100644 index 0000000..0705e21 --- /dev/null +++ b/Client/ThirdParty/fpm/3rdparty/googlebench/src/benchmark_register.h @@ -0,0 +1,33 @@ +#ifndef BENCHMARK_REGISTER_H +#define BENCHMARK_REGISTER_H + +#include <vector> + +#include "check.h" + +template <typename T> +void AddRange(std::vector<T>* dst, T lo, T hi, int mult) { + CHECK_GE(lo, 0); + CHECK_GE(hi, lo); + CHECK_GE(mult, 2); + + // Add "lo" + dst->push_back(lo); + + static const T kmax = std::numeric_limits<T>::max(); + + // Now space out the benchmarks in multiples of "mult" + for (T i = 1; i < kmax / mult; i *= mult) { + if (i >= hi) break; + if (i > lo) { + dst->push_back(i); + } + } + + // Add "hi" (if different from "lo") + if (hi != lo) { + dst->push_back(hi); + } +} + +#endif // BENCHMARK_REGISTER_H |
