diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-01-20 14:51:48 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-01-20 14:51:48 -0800 |
commit | 47076bf00ec32c41c0a7f2ba438361ea5f0256e4 (patch) | |
tree | ae265dc0cc3f6034ef6019e5fd12ef943d643bdf /unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h | |
parent | ebd3388ee666c41e88bbea88f61b7a65e38ade47 (diff) |
Reduce the register pressure exerted by the tensor mappers whenever possible. This improves the performance of the contraction of a matrix with a vector by about 35%.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h index 506696ae9..575ae7b54 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h @@ -128,6 +128,7 @@ struct TensorContractionEvaluatorBase PacketAccess = (internal::packet_traits<Scalar>::size > 1), Layout = TensorEvaluator<LeftArgType, Device>::Layout, CoordAccess = false, // to be implemented + RawAccess = true }; // Most of the code is assuming that both input tensors are ColMajor. If the @@ -434,11 +435,11 @@ struct TensorContractionEvaluatorBase } template<int LoadMode> - EIGEN_DEVICE_FUNC PacketReturnType packet(Index index) const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const { return internal::ploadt<Packet, LoadMode>(m_result + index); } - EIGEN_DEVICE_FUNC Scalar* data() const { return NULL; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar* data() const { return m_result; } protected: // Prevent assignment |