-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
57 lines (51 loc) · 1.12 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <benchmark/benchmark.h>
#include <x86intrin.h>
extern "C" void fun_1024();
extern "C" void fun_2048();
extern "C" void fun_4096();
extern "C" void fun_8192();
extern "C" void fun_16384();
extern "C" void fun_32768();
extern "C" void fun_65536();
extern "C" void fun_131072();
extern "C" void fun_262144();
extern "C" void fun_524288();
extern "C" void fun_1048576();
extern "C" void fun_2097152();
extern "C" void fun_4194304();
extern "C" void fun_8388608();
extern "C" void fun_16777216();
extern "C" void fun_33554432();
extern "C" void fun_67108864();
extern "C" void fun_134217728();
extern "C" void fun_268435456();
extern "C" void fun_536870912();
static void (*funs[])(void) = {
fun_1024,
fun_2048,
fun_4096,
fun_8192,
fun_16384,
fun_32768,
fun_65536,
fun_131072,
fun_262144,
fun_524288,
fun_1048576,
fun_2097152,
fun_4194304,
fun_8388608,
fun_16777216,
fun_33554432,
fun_67108864,
fun_134217728,
fun_268435456,
fun_536870912,
};
void BM(benchmark::State &state) {
for (auto _ : state) {
funs[state.range(0)]();
}
}
BENCHMARK(BM)->DenseRange(0, 19, 1);
BENCHMARK_MAIN();