Improved the performance of tensor padding

This commit is contained in:
Benoit Steiner
2016-05-25 11:43:08 -07:00
parent 58026905ae
commit 034aa3b2c0
2 changed files with 53 additions and 54 deletions

View File

@@ -178,9 +178,14 @@ template <typename Device, typename T> class BenchmarkSuite {
size_b[1] = m_;
TensorMap<Tensor<T, 2>, Eigen::Aligned> B(b_, size_b);
#if defined(EIGEN_HAS_INDEX_LIST)
Eigen::IndexPairList<Eigen::type2indexpair<0, 0>,
Eigen::type2indexpair<2, 1> > paddings;
#else
Eigen::array<Eigen::IndexPair<TensorIndex>, 2> paddings;
paddings[0] = Eigen::IndexPair<TensorIndex>(0, 0);
paddings[1] = Eigen::IndexPair<TensorIndex>(2, 1);
#endif
StartBenchmarkTiming();
for (int iter = 0; iter < num_iters; ++iter) {