aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/tensors
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-04-21 11:58:27 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-04-21 11:58:27 -0700
commit79b900375fc0bffd659b19f56818156942687b0c (patch)
tree62575307171330a16ff3e69c00d368b8b573db6e /bench/tensors
parentf670613e4b90609229b016c3e2d1be9f4b8d54eb (diff)
Use index list for the striding benchmarks
Diffstat (limited to 'bench/tensors')
-rw-r--r--bench/tensors/tensor_benchmarks.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/bench/tensors/tensor_benchmarks.h b/bench/tensors/tensor_benchmarks.h
index 90b9bc741..62533a608 100644
--- a/bench/tensors/tensor_benchmarks.h
+++ b/bench/tensors/tensor_benchmarks.h
@@ -201,9 +201,15 @@ template <typename Device, typename T> class BenchmarkSuite {
size_b[1] = k_/2;
TensorMap<Tensor<T, 2>, Eigen::Aligned> B(b_, size_b);
+#ifndef EIGEN_HAS_INDEX_LIST
Eigen::array<TensorIndex, 2> strides;
strides[0] = 1;
strides[1] = 2;
+#else
+ // Take advantage of cxx11 to give the compiler information it can use to
+ // optimize the code.
+ Eigen::IndexList<Eigen::type2index<1>, Eigen::type2index<2> > strides;
+#endif
StartBenchmarkTiming();
for (int iter = 0; iter < num_iters; ++iter) {