diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2014-10-17 15:33:27 -0700 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2014-10-17 15:33:27 -0700 |
commit | f786897e4b96737767effc85bedb78f06dc46dc5 (patch) | |
tree | 10b3826431621b424eb171cc95aae14c15d4fcea /unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h | |
parent | 7acd38d19e2f9559825c78b4be8644f3b10496fb (diff) |
Added access to the unerlying raw data of a tnsor slice/chip whenever possible
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h index 3aa3eba24..b862a8fd3 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h @@ -157,7 +157,14 @@ struct TensorEvaluator<const TensorChippingOp<DimId, ArgType>, Device> }*/ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar* data() const { return NULL; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar* data() const { + Scalar* result = m_impl.data(); + if (DimId == NumDims && result) { + return result + m_inputOffset; + } else { + return NULL; + } + } protected: EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index srcCoeff(Index index) const |