| 34 | void ignore(const T&) {} |
| 35 | |
| 36 | double baseline(unsigned n) { |
| 37 | auto r = random_array(n, 0); |
| 38 | |
| 39 | auto best = std::numeric_limits<double>::max(); |
| 40 | for (unsigned k = 0; k < 20; ++k) { |
| 41 | auto t = clock(); |
| 42 | for (unsigned i = 0; i < n; ++i) { |
| 43 | volatile auto x = r[i]; |
| 44 | ignore(x); |
| 45 | } |
| 46 | t = clock() - t; |
| 47 | best = std::min(best, double(t) / CLOCKS_PER_SEC); |
| 48 | } |
| 49 | return best; |
| 50 | } |
| 51 | |
| 52 | template <typename Tag, typename Storage> |
| 53 | double compare_1d(unsigned n, int distrib) { |
no test coverage detected