From 96a24b05cc836072ce0fd2b50c4e94ea652bd1aa Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Sun, 21 Feb 2016 11:16:15 -0800 Subject: Optimized casting of tensors in the case where the casting happens to be a no-op --- unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h index e254c0b7b..21bb91d69 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h @@ -195,8 +195,11 @@ struct TensorEvaluator, Device> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_impl.dimensions(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(Scalar* /*data*/) + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(Scalar* data) { + if (internal::is_same::value) { + return m_impl.evalSubExprsIfNeeded((SrcType*)data); + } m_impl.evalSubExprsIfNeeded(NULL); return true; } -- cgit v1.2.3