|
2 | 2 |
|
3 | 3 | #include <cpuinfo.h> |
4 | 4 |
|
5 | | -static void cpuinfo_get_current_processor(benchmark::State& state) { |
| 5 | +static void cpuinfo_get_current_processor_bench(benchmark::State& state) { |
6 | 6 | cpuinfo_initialize(); |
7 | 7 | while (state.KeepRunning()) { |
8 | 8 | const cpuinfo_processor* current_processor = cpuinfo_get_current_processor(); |
9 | 9 | benchmark::DoNotOptimize(current_processor); |
10 | 10 | } |
11 | 11 | } |
12 | | -BENCHMARK(cpuinfo_get_current_processor)->Unit(benchmark::kNanosecond); |
| 12 | +BENCHMARK(cpuinfo_get_current_processor_bench)->Unit(benchmark::kNanosecond); |
13 | 13 |
|
14 | | -static void cpuinfo_get_current_core(benchmark::State& state) { |
| 14 | +static void cpuinfo_get_current_core_bench(benchmark::State& state) { |
15 | 15 | cpuinfo_initialize(); |
16 | 16 | while (state.KeepRunning()) { |
17 | 17 | const cpuinfo_core* current_core = cpuinfo_get_current_core(); |
18 | 18 | benchmark::DoNotOptimize(current_core); |
19 | 19 | } |
20 | 20 | } |
21 | | -BENCHMARK(cpuinfo_get_current_core)->Unit(benchmark::kNanosecond); |
| 21 | +BENCHMARK(cpuinfo_get_current_core_bench)->Unit(benchmark::kNanosecond); |
22 | 22 |
|
23 | | -static void cpuinfo_get_current_uarch_index(benchmark::State& state) { |
| 23 | +static void cpuinfo_get_current_uarch_index_bench(benchmark::State& state) { |
24 | 24 | cpuinfo_initialize(); |
25 | 25 | while (state.KeepRunning()) { |
26 | 26 | const uint32_t uarch_index = cpuinfo_get_current_uarch_index(); |
27 | 27 | benchmark::DoNotOptimize(uarch_index); |
28 | 28 | } |
29 | 29 | } |
30 | | -BENCHMARK(cpuinfo_get_current_uarch_index)->Unit(benchmark::kNanosecond); |
| 30 | +BENCHMARK(cpuinfo_get_current_uarch_index_bench)->Unit(benchmark::kNanosecond); |
31 | 31 |
|
32 | | -static void cpuinfo_get_current_uarch_index_with_default(benchmark::State& state) { |
| 32 | +static void cpuinfo_get_current_uarch_index_with_default_bench(benchmark::State& state) { |
33 | 33 | cpuinfo_initialize(); |
34 | 34 | while (state.KeepRunning()) { |
35 | 35 | const uint32_t uarch_index = cpuinfo_get_current_uarch_index_with_default(0); |
36 | 36 | benchmark::DoNotOptimize(uarch_index); |
37 | 37 | } |
38 | 38 | } |
39 | | -BENCHMARK(cpuinfo_get_current_uarch_index_with_default)->Unit(benchmark::kNanosecond); |
| 39 | +BENCHMARK(cpuinfo_get_current_uarch_index_with_default_bench)->Unit(benchmark::kNanosecond); |
40 | 40 |
|
41 | 41 | BENCHMARK_MAIN(); |
0 commit comments