mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-10 15:11:50 +08:00
fix Warray-bounds in inner product
This commit is contained in:
parent
66f7f51b7e
commit
4dda5b927a
@ -57,16 +57,20 @@ struct inner_product_assert {
|
|||||||
|
|
||||||
template <typename Func, typename Lhs, typename Rhs>
|
template <typename Func, typename Lhs, typename Rhs>
|
||||||
struct inner_product_evaluator {
|
struct inner_product_evaluator {
|
||||||
static constexpr int LhsFlags = evaluator<Lhs>::Flags, RhsFlags = evaluator<Rhs>::Flags,
|
static constexpr int LhsFlags = evaluator<Lhs>::Flags;
|
||||||
SizeAtCompileTime = min_size_prefer_fixed(Lhs::SizeAtCompileTime, Rhs::SizeAtCompileTime),
|
static constexpr int RhsFlags = evaluator<Rhs>::Flags;
|
||||||
LhsAlignment = evaluator<Lhs>::Alignment, RhsAlignment = evaluator<Rhs>::Alignment;
|
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<Lhs>::Alignment;
|
||||||
|
static constexpr int RhsAlignment = evaluator<Rhs>::Alignment;
|
||||||
|
|
||||||
using Scalar = typename Func::result_type;
|
using Scalar = typename Func::result_type;
|
||||||
using Packet = typename find_inner_product_packet<Scalar, SizeAtCompileTime>::type;
|
using Packet = typename find_inner_product_packet<Scalar, SizeAtCompileTime>::type;
|
||||||
|
|
||||||
static constexpr bool Vectorize =
|
static constexpr bool Vectorize =
|
||||||
bool(LhsFlags & RhsFlags & PacketAccessBit) && Func::PacketAccess &&
|
bool(LhsFlags & RhsFlags & PacketAccessBit) && Func::PacketAccess &&
|
||||||
((SizeAtCompileTime == Dynamic) || (unpacket_traits<Packet>::size <= SizeAtCompileTime));
|
((MaxSizeAtCompileTime == Dynamic) || (unpacket_traits<Packet>::size <= MaxSizeAtCompileTime));
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit inner_product_evaluator(const Lhs& lhs, const Rhs& rhs,
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit inner_product_evaluator(const Lhs& lhs, const Rhs& rhs,
|
||||||
Func func = Func())
|
Func func = Func())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user