From 13c3327f5cf829fd9d04a2ab46861e722cd74ca0 Mon Sep 17 00:00:00 2001 From: Eugene Zhulenev Date: Tue, 12 Nov 2019 10:12:28 -0800 Subject: Remove legacy block evaluation support --- .../Eigen/CXX11/src/Tensor/TensorChipping.h | 68 ---------------------- 1 file changed, 68 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h index 32d6960bf..098110217 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h @@ -148,7 +148,6 @@ struct TensorEvaluator, Device> IsAligned = false, Layout = TensorEvaluator::Layout, PacketAccess = TensorEvaluator::PacketAccess, - BlockAccess = TensorEvaluator::BlockAccess, BlockAccessV2 = TensorEvaluator::BlockAccessV2, // Chipping of outer-most dimension is a trivial operation, because we can // read and write directly from the underlying tensor using single offset. @@ -167,11 +166,6 @@ struct TensorEvaluator, Device> typedef typename internal::remove_const::type ScalarNoConst; - typedef internal::TensorBlock - InputTensorBlock; - typedef internal::TensorBlock - OutputTensorBlock; - //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===// typedef internal::TensorBlockDescriptor TensorBlockDesc; typedef internal::TensorBlockScratchAllocator TensorBlockScratch; @@ -218,20 +212,6 @@ struct TensorEvaluator, Device> } m_inputStride *= input_dims[m_dim.actualDim()]; m_inputOffset = m_stride * op.offset(); - - if (BlockAccess) { - if (static_cast(Layout) == static_cast(ColMajor)) { - m_inputStrides[0] = 1; - for (int i = 1; i < NumInputDims; ++i) { - m_inputStrides[i] = m_inputStrides[i - 1] * input_dims[i - 1]; - } - } else { - m_inputStrides[NumInputDims - 1] = 1; - for (int i = NumInputDims - 2; i >= 0; --i) { - m_inputStrides[i] = m_inputStrides[i + 1] * input_dims[i + 1]; - } - } - } } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_dimensions; } @@ -323,52 +303,6 @@ struct TensorEvaluator, Device> m_impl.getResourceRequirements(resources); } - // TODO(andydavis) Reduce the overhead of this function (experiment with - // using a fixed block size). - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void block( - OutputTensorBlock* output_block) const { - // Calculate input block sizes. - const DSizes& output_block_sizes = - output_block->block_sizes(); - const DSizes& output_block_strides = - output_block->block_strides(); - const Index chip_dim = m_dim.actualDim(); - DSizes input_block_sizes; - DSizes input_block_strides; - for (Index i = 0; i < NumInputDims; ++i) { - if (i < chip_dim) { - input_block_sizes[i] = output_block_sizes[i]; - input_block_strides[i] = output_block_strides[i]; - } else if (i > chip_dim) { - input_block_sizes[i] = output_block_sizes[i - 1]; - input_block_strides[i] = output_block_strides[i - 1]; - } else { - input_block_sizes[i] = 1; - } - } - // Fix up input_block_stride for chip dimension. - if (static_cast(Layout) == static_cast(ColMajor)) { - if (chip_dim == 0) { - input_block_strides[chip_dim] = 1; - } else { - input_block_strides[chip_dim] = - input_block_strides[chip_dim - 1] * input_block_sizes[chip_dim - 1]; - } - } else { - if (chip_dim == NumInputDims - 1) { - input_block_strides[chip_dim] = 1; - } else { - input_block_strides[chip_dim] = - input_block_strides[chip_dim + 1] * input_block_sizes[chip_dim + 1]; - } - } - // Instantiate and read input block from input tensor. - InputTensorBlock input_block(srcCoeff(output_block->first_coeff_index()), - input_block_sizes, input_block_strides, - m_inputStrides, output_block->data()); - m_impl.block(&input_block); - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlockV2 blockV2(TensorBlockDesc& desc, TensorBlockScratch& scratch, bool root_of_expr_ast = false) const { @@ -482,7 +416,6 @@ struct TensorEvaluator, Device> Index m_stride; Index m_inputOffset; Index m_inputStride; - DSizes m_inputStrides; TensorEvaluator m_impl; const internal::DimensionId m_dim; const Device EIGEN_DEVICE_REF m_device; @@ -508,7 +441,6 @@ struct TensorEvaluator, Device> enum { IsAligned = false, PacketAccess = TensorEvaluator::PacketAccess, - BlockAccess = TensorEvaluator::BlockAccess, BlockAccessV2 = TensorEvaluator::RawAccess, Layout = TensorEvaluator::Layout, RawAccess = false -- cgit v1.2.3