diff options
author | Ashkan Aliabadi <ashkan.aliabadi@gmail.com> | 2020-05-08 20:40:33 -0700 |
---|---|---|
committer | David Reiss <dreiss@fb.com> | 2020-05-11 09:57:00 -0700 |
commit | c2092219e7c874783a00a62edb94ddc672f57ab3 (patch) | |
tree | 87c8ea93fb7e78de4243ae874fc0686c20ef26fc /bench | |
parent | 2b14e445016dd46f7de821cdf3093e2823b9ab21 (diff) | |
download | cpuinfo-c2092219e7c874783a00a62edb94ddc672f57ab3.tar.gz |
Upstream cpuinfo updates in XNNPACK as of XNNPACK:d793f6c2ec145be3ddbffea951e6e5480f4646b8.
Diffstat (limited to 'bench')
-rw-r--r-- | bench/get-current.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bench/get-current.cc b/bench/get-current.cc index b547df0..e475767 100644 --- a/bench/get-current.cc +++ b/bench/get-current.cc @@ -30,4 +30,13 @@ static void cpuinfo_get_current_uarch_index(benchmark::State& state) { } BENCHMARK(cpuinfo_get_current_uarch_index)->Unit(benchmark::kNanosecond); +static void cpuinfo_get_current_uarch_index_with_default(benchmark::State& state) { + cpuinfo_initialize(); + while (state.KeepRunning()) { + const uint32_t uarch_index = cpuinfo_get_current_uarch_index_with_default(0); + benchmark::DoNotOptimize(uarch_index); + } +} +BENCHMARK(cpuinfo_get_current_uarch_index_with_default)->Unit(benchmark::kNanosecond); + BENCHMARK_MAIN(); |