adding iris benchmark
[c11concurrency-benchmarks.git] / iris / include / utils.h
1 #ifndef IRIS_UTILS_H_
2 #define IRIS_UTILS_H_
3 #include <sys/time.h>
4
5 #include <cstddef>
6 namespace iris{
7
8 long long get_current_time_in_us();
9
10
11 int round_up_to_next_multiple_of_2(int n);
12
13 /* utilitis for making sequence for tuple element retrieval */
14 template<size_t ...> struct seq {};
15 template<size_t idx, std::size_t N, std::size_t... S> struct seq_helper: seq_helper<idx + 1, N, S..., idx> {};
16 template<size_t N, size_t ...S> struct seq_helper<N, N, S...> {
17     typedef seq<S...> type;
18 };
19 template<size_t N>
20 struct make_sequence {
21     typedef typename seq_helper<0, N>::type type;
22 };
23
24
25 }
26 #endif