|
33 | 33 | #define RANGE 128, 128
|
34 | 34 | #define MULTIPLIER 8
|
35 | 35 |
|
| 36 | +#define XTENSOR_VERSION (XTENSOR_VERSION_MAJOR * 10000 \ |
| 37 | + + XTENSOR_VERSION_MINOR * 100 \ |
| 38 | + + XTENSOR_VERSION_PATCH) |
| 39 | + |
36 | 40 | namespace xt
|
37 | 41 | {
|
38 | 42 | void xtensor_view(benchmark::State& state)
|
@@ -64,7 +68,11 @@ namespace xt
|
64 | 68 | tensor a = random::rand<double>({state.range(0), state.range(0)});
|
65 | 69 | tensor b = random::rand<double>({state.range(0), state.range(0)});
|
66 | 70 |
|
67 |
| - auto sv = xt::slice_vector(a, range(0, 5), range(0, 5)); |
| 71 | + #if XTENSOR_VERSION > 1505 |
| 72 | + auto sv = xt::slice_vector{range(0, 5), range(0, 5)}; |
| 73 | + #else |
| 74 | + auto sv = xt::slice_vector(a, {range(0, 5), range(0, 5)}); |
| 75 | + #endif |
68 | 76 |
|
69 | 77 | auto av = xt::dynamic_view(a, sv);
|
70 | 78 | auto bv = xt::dynamic_view(b, sv);
|
@@ -123,7 +131,11 @@ namespace xt
|
123 | 131 | tensor a = random::rand<double>({state.range(0)});
|
124 | 132 | tensor b = random::rand<double>({state.range(0)});
|
125 | 133 |
|
| 134 | + #if XTENSOR_VERSION > 1505 |
| 135 | + auto sv = xt::slice_vector{range(0, state.range(0), 2)}; |
| 136 | + #else |
126 | 137 | auto sv = xt::slice_vector(a, range(0, state.range(0), 2));
|
| 138 | + #endif |
127 | 139 |
|
128 | 140 | auto av = xt::dynamic_view(a, sv);
|
129 | 141 | auto bv = xt::dynamic_view(b, sv);
|
|
0 commit comments