diff options
author | Eugene Zhulenev <ezhulenev@google.com> | 2018-08-09 09:44:07 -0700 |
---|---|---|
committer | Eugene Zhulenev <ezhulenev@google.com> | 2018-08-09 09:44:07 -0700 |
commit | cfaedb38cd662def3b5684a20965b3bc1b0d6a3f (patch) | |
tree | 82dc639a1f91a2eebd9d1afb777945dd8830ff70 /unsupported/Eigen | |
parent | 1c8b9e10a791cb43b4f730dcb5d7889099cc1c68 (diff) |
Fix bug in a test + compilation errors
Diffstat (limited to 'unsupported/Eigen')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h | 6 | ||||
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h index f11241f83..4bc18bd97 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h @@ -115,6 +115,7 @@ class TensorExecutor<Expression, DefaultDevice, Vectorizable, const DefaultDevice& device = DefaultDevice()) { typedef TensorBlock<ScalarNoConst, StorageIndex, NumDims, Evaluator::Layout> TensorBlock; + typedef typename TensorBlock::Dimensions TensorBlockDimensions; typedef TensorBlockMapper<ScalarNoConst, StorageIndex, NumDims, Evaluator::Layout> TensorBlockMapper; @@ -141,8 +142,9 @@ class TensorExecutor<Expression, DefaultDevice, Vectorizable, evaluator.getResourceRequirements(&resources); MergeResourceRequirements(resources, &block_shape, &block_total_size); - TensorBlockMapper block_mapper(evaluator.dimensions(), block_shape, - block_total_size); + TensorBlockMapper block_mapper( + TensorBlockDimensions(evaluator.dimensions()), block_shape, + block_total_size); block_total_size = block_mapper.block_dims_total_size(); Scalar* data = static_cast<Scalar*>( diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h index d5b0c1237..b25c1eabc 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h @@ -520,6 +520,7 @@ struct TensorEvaluator<const TensorSlicingOp<StartIndices, Sizes, ArgType>, Devi typedef internal::TensorBlock<ScalarNoConst, Index, NumDims, Layout> TensorBlock; + typedef typename TensorBlock::Dimensions TensorBlockDimensions; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) : m_impl(op.expression(), device), m_device(device), m_dimensions(op.sizes()), m_offsets(op.startIndices()) @@ -687,7 +688,7 @@ struct TensorEvaluator<const TensorSlicingOp<StartIndices, Sizes, ArgType>, Devi TensorBlock input_block(srcCoeff(output_block->first_coeff_index()), output_block->block_sizes(), output_block->block_strides(), - Dimensions(m_inputStrides), + TensorBlockDimensions(m_inputStrides), output_block->data()); m_impl.block(&input_block); } @@ -796,6 +797,7 @@ struct TensorEvaluator<TensorSlicingOp<StartIndices, Sizes, ArgType>, Device> typedef internal::TensorBlock<ScalarNoConst, Index, NumDims, Layout> TensorBlock; + typedef typename TensorBlock::Dimensions TensorBlockDimensions; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op, const Device& device) : Base(op, device) @@ -862,13 +864,11 @@ struct TensorEvaluator<TensorSlicingOp<StartIndices, Sizes, ArgType>, Device> const TensorBlock& block) { this->m_impl.writeBlock(TensorBlock( this->srcCoeff(block.first_coeff_index()), block.block_sizes(), - block.block_strides(), Dimensions(this->m_inputStrides), + block.block_strides(), TensorBlockDimensions(this->m_inputStrides), const_cast<ScalarNoConst*>(block.data()))); } }; - - namespace internal { template<typename StartIndices, typename StopIndices, typename Strides, typename XprType> struct traits<TensorStridingSlicingOp<StartIndices, StopIndices, Strides, XprType> > : public traits<XprType> |