mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-07 21:51:47 +08:00
fix one useless temp & copy
This commit is contained in:
parent
1cb59e4781
commit
8185a3c6cf
@ -389,7 +389,7 @@ template <>
|
|||||||
struct ei_unaligned_assign_impl<false>
|
struct ei_unaligned_assign_impl<false>
|
||||||
{
|
{
|
||||||
// MSVC must not inline this functions. If it does, it fails to optimize the
|
// MSVC must not inline this functions. If it does, it fails to optimize the
|
||||||
// packet access path.
|
// packet access path.
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
template <typename Derived, typename OtherDerived>
|
template <typename Derived, typename OtherDerived>
|
||||||
static EIGEN_DONT_INLINE void run(const Derived& src, OtherDerived& dst, int start, int end)
|
static EIGEN_DONT_INLINE void run(const Derived& src, OtherDerived& dst, int start, int end)
|
||||||
@ -415,7 +415,7 @@ struct ei_assign_impl<Derived1, Derived2, LinearVectorizedTraversal, NoUnrolling
|
|||||||
const int alignedEnd = alignedStart + ((size-alignedStart)/packetSize)*packetSize;
|
const int alignedEnd = alignedStart + ((size-alignedStart)/packetSize)*packetSize;
|
||||||
|
|
||||||
ei_unaligned_assign_impl<ei_assign_traits<Derived1,Derived2>::DstIsAligned!=0>::run(src,dst,0,alignedStart);
|
ei_unaligned_assign_impl<ei_assign_traits<Derived1,Derived2>::DstIsAligned!=0>::run(src,dst,0,alignedStart);
|
||||||
|
|
||||||
for(int index = alignedStart; index < alignedEnd; index += packetSize)
|
for(int index = alignedStart; index < alignedEnd; index += packetSize)
|
||||||
{
|
{
|
||||||
dst.template copyPacket<Derived2, Aligned, ei_assign_traits<Derived1,Derived2>::SrcAlignment>(index, src);
|
dst.template copyPacket<Derived2, Aligned, ei_assign_traits<Derived1,Derived2>::SrcAlignment>(index, src);
|
||||||
|
@ -86,9 +86,9 @@ struct ei_traits<CoeffBasedProduct<LhsNested,RhsNested,NestingFlags> >
|
|||||||
| (CanVectorizeLhs || CanVectorizeRhs ? PacketAccessBit : 0)
|
| (CanVectorizeLhs || CanVectorizeRhs ? PacketAccessBit : 0)
|
||||||
| (LhsFlags & RhsFlags & AlignedBit),
|
| (LhsFlags & RhsFlags & AlignedBit),
|
||||||
|
|
||||||
CoeffReadCost = 1000,//InnerSize == Dynamic ? Dynamic
|
CoeffReadCost = InnerSize == Dynamic ? Dynamic
|
||||||
// : InnerSize * (NumTraits<Scalar>::MulCost + LhsCoeffReadCost + RhsCoeffReadCost)
|
: InnerSize * (NumTraits<Scalar>::MulCost + LhsCoeffReadCost + RhsCoeffReadCost)
|
||||||
// + (InnerSize - 1) * NumTraits<Scalar>::AddCost,
|
+ (InnerSize - 1) * NumTraits<Scalar>::AddCost,
|
||||||
|
|
||||||
/* CanVectorizeInner deserves special explanation. It does not affect the product flags. It is not used outside
|
/* CanVectorizeInner deserves special explanation. It does not affect the product flags. It is not used outside
|
||||||
* of Product. If the Product itself is not a packet-access expression, there is still a chance that the inner
|
* of Product. If the Product itself is not a packet-access expression, there is still a chance that the inner
|
||||||
@ -178,7 +178,7 @@ class CoeffBasedProduct
|
|||||||
// Implicit convertion to the nested type (trigger the evaluation of the product)
|
// Implicit convertion to the nested type (trigger the evaluation of the product)
|
||||||
operator const PlainMatrixType& () const
|
operator const PlainMatrixType& () const
|
||||||
{
|
{
|
||||||
m_result = *this;
|
m_result.lazyAssign(*this);
|
||||||
return m_result;
|
return m_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user