From 4dda5b927a3d5cfedad812ba7c1a966dd983e624 Mon Sep 17 00:00:00 2001 From: Charles Schlosser Date: Thu, 20 Feb 2025 22:40:55 +0000 Subject: [PATCH] fix Warray-bounds in inner product --- Eigen/src/Core/InnerProduct.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Eigen/src/Core/InnerProduct.h b/Eigen/src/Core/InnerProduct.h index 1e16942c2..9849d9b1f 100644 --- a/Eigen/src/Core/InnerProduct.h +++ b/Eigen/src/Core/InnerProduct.h @@ -57,16 +57,20 @@ struct inner_product_assert { template struct inner_product_evaluator { - static constexpr int LhsFlags = evaluator::Flags, RhsFlags = evaluator::Flags, - SizeAtCompileTime = min_size_prefer_fixed(Lhs::SizeAtCompileTime, Rhs::SizeAtCompileTime), - LhsAlignment = evaluator::Alignment, RhsAlignment = evaluator::Alignment; + static constexpr int LhsFlags = evaluator::Flags; + static constexpr int RhsFlags = evaluator::Flags; + static constexpr int SizeAtCompileTime = size_prefer_fixed(Lhs::SizeAtCompileTime, Rhs::SizeAtCompileTime); + static constexpr int MaxSizeAtCompileTime = + min_size_prefer_fixed(Lhs::MaxSizeAtCompileTime, Rhs::MaxSizeAtCompileTime); + static constexpr int LhsAlignment = evaluator::Alignment; + static constexpr int RhsAlignment = evaluator::Alignment; using Scalar = typename Func::result_type; using Packet = typename find_inner_product_packet::type; static constexpr bool Vectorize = bool(LhsFlags & RhsFlags & PacketAccessBit) && Func::PacketAccess && - ((SizeAtCompileTime == Dynamic) || (unpacket_traits::size <= SizeAtCompileTime)); + ((MaxSizeAtCompileTime == Dynamic) || (unpacket_traits::size <= MaxSizeAtCompileTime)); EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit inner_product_evaluator(const Lhs& lhs, const Rhs& rhs, Func func = Func())