From 33e174613987cfc6c83576dc0fe8086c7a5d1b1f Mon Sep 17 00:00:00 2001 From: Eugene Zhulenev Date: Wed, 9 Oct 2019 12:45:31 -0700 Subject: Block evaluation for TensorChipping + fixed bugs in TensorPadding and TensorSlicing --- .../Eigen/CXX11/src/Tensor/TensorEvaluator.h | 27 +++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h b/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h index b1d668744..b77d8fe84 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h @@ -53,18 +53,22 @@ struct TensorEvaluator RawAccess = true }; - typedef typename internal::TensorBlock< - typename internal::remove_const::type, Index, NumCoords, Layout> + typedef typename internal::remove_const::type ScalarNoConst; + + typedef typename internal::TensorBlock TensorBlock; - typedef typename internal::TensorBlockReader< - typename internal::remove_const::type, Index, NumCoords, Layout> + typedef typename internal::TensorBlockReader TensorBlockReader; - typedef typename internal::TensorBlockWriter< - typename internal::remove_const::type, Index, NumCoords, Layout> + typedef typename internal::TensorBlockWriter TensorBlockWriter; //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// typedef internal::TensorBlockDescriptor TensorBlockDesc; + typedef internal::TensorBlockScratchAllocator TensorBlockScratch; + + typedef typename internal::TensorMaterializedBlock + TensorBlockV2; //===--------------------------------------------------------------------===// EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const Derived& m, const Device& device) @@ -161,6 +165,12 @@ struct TensorEvaluator TensorBlockReader::Run(block, m_data); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlockV2 + blockV2(TensorBlockDesc& desc, TensorBlockScratch& scratch) const { + assert(m_data != NULL); + return TensorBlockV2::materialize(m_data, m_dims, desc, scratch); + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writeBlock( const TensorBlock& block) { assert(m_data != NULL); @@ -269,11 +279,6 @@ struct TensorEvaluator typedef internal::TensorBlockDescriptor TensorBlockDesc; typedef internal::TensorBlockScratchAllocator TensorBlockScratch; - typedef internal::TensorBlockIOV2 - TensorBlockIO; - typedef typename TensorBlockIO::Dst TensorBlockIODst; - typedef typename TensorBlockIO::Src TensorBlockIOSrc; - typedef typename internal::TensorMaterializedBlock TensorBlockV2; -- cgit v1.2.3