aboutsummaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorAshkan Aliabadi <ashkan.aliabadi@gmail.com>2020-05-08 20:40:33 -0700
committerDavid Reiss <dreiss@fb.com>2020-05-11 09:57:00 -0700
commitc2092219e7c874783a00a62edb94ddc672f57ab3 (patch)
tree87c8ea93fb7e78de4243ae874fc0686c20ef26fc /bench
parent2b14e445016dd46f7de821cdf3093e2823b9ab21 (diff)
downloadcpuinfo-c2092219e7c874783a00a62edb94ddc672f57ab3.tar.gz
Upstream cpuinfo updates in XNNPACK as of XNNPACK:d793f6c2ec145be3ddbffea951e6e5480f4646b8.
Diffstat (limited to 'bench')
-rw-r--r--bench/get-current.cc9
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();