From 2918f85ba976dbfbf72f7d4c1961a577f5850148 Mon Sep 17 00:00:00 2001 From: Eugene Zhulenev Date: Mon, 9 Dec 2019 16:19:38 -0800 Subject: Do not use std::vector in getResourceRequirements --- unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 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 098110217..9b835c4de 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h @@ -294,13 +294,14 @@ struct TensorEvaluator, Device> TensorOpCost(0, 0, cost, vectorized, PacketSize); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void getResourceRequirements( - std::vector* resources) const { - Eigen::Index block_total_size_max = numext::maxi( - 1, m_device.lastLevelCacheSize() / sizeof(Scalar)); - resources->push_back(internal::TensorOpResourceRequirements( - internal::kSkewedInnerDims, block_total_size_max)); - m_impl.getResourceRequirements(resources); + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + internal::TensorBlockV2ResourceRequirements getResourceRequirements() const { + const size_t target_block_size = + numext::maxi(1, m_device.lastLevelCacheSize() / sizeof(Scalar)); + + return internal::TensorBlockV2ResourceRequirements::merge( + {internal::TensorBlockV2ShapeType::kSkewedInnerDims, target_block_size}, + m_impl.getResourceRequirements()); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlockV2 -- cgit v1.2.3