Skip to content

Commit 5cc89c1

Browse files
committed
include 15.05 in range
1 parent 3503d58 commit 5cc89c1

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/benchmark_views.hpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
#define RANGE 128, 128
3434
#define MULTIPLIER 8
3535

36+
#define XTENSOR_VERSION (XTENSOR_VERSION_MAJOR * 10000 \
37+
+ XTENSOR_VERSION_MINOR * 100 \
38+
+ XTENSOR_VERSION_PATCH)
39+
3640
namespace xt
3741
{
3842
void xtensor_view(benchmark::State& state)
@@ -64,7 +68,11 @@ namespace xt
6468
tensor a = random::rand<double>({state.range(0), state.range(0)});
6569
tensor b = random::rand<double>({state.range(0), state.range(0)});
6670

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
6876

6977
auto av = xt::dynamic_view(a, sv);
7078
auto bv = xt::dynamic_view(b, sv);
@@ -123,7 +131,11 @@ namespace xt
123131
tensor a = random::rand<double>({state.range(0)});
124132
tensor b = random::rand<double>({state.range(0)});
125133

134+
#if XTENSOR_VERSION > 1505
135+
auto sv = xt::slice_vector{range(0, state.range(0), 2)};
136+
#else
126137
auto sv = xt::slice_vector(a, range(0, state.range(0), 2));
138+
#endif
127139

128140
auto av = xt::dynamic_view(a, sv);
129141
auto bv = xt::dynamic_view(b, sv);

0 commit comments

Comments
 (0)