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/TensorShuffling.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 655fd91e8..42bca8172 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -244,18 +244,19 @@ struct TensorEvaluator, Device> return PacketLoader::PacketAccess>::Run(*this, index); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void getResourceRequirements( - std::vector* resources) const { + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + internal::TensorBlockV2ResourceRequirements getResourceRequirements() const { static const int inner_dim = Layout == static_cast(ColMajor) ? 0 : NumDims - 1; - const bool inner_dim_shuffled = m_shuffle[inner_dim] != inner_dim; - Eigen::Index block_total_size_max = numext::maxi( + const size_t target_block_size = numext::maxi( 1, m_device.firstLevelCacheSize() / sizeof(Scalar)); - resources->push_back(internal::TensorOpResourceRequirements( - inner_dim_shuffled ? internal::kUniformAllDims - : internal::kSkewedInnerDims, - block_total_size_max)); + + const bool inner_dim_shuffled = m_shuffle[inner_dim] != inner_dim; + return {inner_dim_shuffled + ? internal::TensorBlockV2ShapeType::kUniformAllDims + : internal::TensorBlockV2ShapeType::kSkewedInnerDims, + target_block_size}; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlockV2 -- cgit v1.2.3