forked from travisdowns/uarch-bench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bench-declarations.h
36 lines (28 loc) · 1019 Bytes
/
bench-declarations.h
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
/*
* bench-declarations.hpp
*
* Basic definitions for benchmark methods types, used by assembly and C/C++ benchmark methods alike.
*/
#ifndef BENCH_DECLARATIONS_H_
#define BENCH_DECLARATIONS_H_
#include <stdint.h>
#if defined(__cplusplus)
extern "C" {
#endif
/**
* The prototype for a benchmark function.
*
* iters: the number of times the benchmark shoudl execute using its internal loop
* arg: the benchmark specific arg, for benchmarks that need an argument (e.g,. a memory region to read from)
*
* return value: ignored by the benchmarking code, but useful for C/C++ benchmarks to return some value that
* depends on the substance of the benchmark so that the method isn't optimized away.
*/
extern "C" typedef long (bench2_f)(uint64_t iters, void *arg);
bench2_f dummy_bench;
// suitable for use with the BOOST_PP_REPEAT macros to generate numbered function declarations
#define DECL_BENCH2(z, n, fname) bench2_f fname ## n;
#if defined(__cplusplus)
}
#endif
#endif /* BENCH_DECLARATIONS_H_ */