aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-01-12 15:21:09 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-01-12 15:21:09 -0800
commit79b69b7444cfae2f7631e873e822cdca6f4e355f (patch)
treeb51097c24f2573f4033b7d75c27b8cbb68eaa150 /unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h
parentd920d57f38e07739403a6c1e224c74fec5a36e6f (diff)
Trigger the optimized matrix vector path more conservatively.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h
index 63d0c6f68..72a378dfd 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h
@@ -145,7 +145,10 @@ class SimpleTensorContractionMapper {
}
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index firstAligned(Index size) const {
- return (Alignment == Aligned) ? 0 : size;
+ // Only claim alignment when we can compute the actual stride (ie when we're
+ // dealing with the lhs with inner_dim_contiguous. This is because the
+ // matrix-vector product relies on the stride when dealing with aligned inputs.
+ return (Alignment == Aligned) && (side == Lhs) && inner_dim_contiguous ? 0 : size;
}
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE Index stride() const {
return ((side == Lhs) && inner_dim_contiguous) ? m_contract_strides[0] : 1;