Favor column major storage for inner products

This commit is contained in:
Gael Guennebaud 2014-09-14 19:38:49 +02:00
parent 26db954776
commit c83e01f2d6
3 changed files with 12 additions and 10 deletions

View File

@ -55,8 +55,8 @@ private:
};
enum {
DstIsRowMajor = DstEvaluator::Flags&RowMajorBit,
SrcIsRowMajor = SrcEvaluator::Flags&RowMajorBit,
DstIsRowMajor = DstFlags&RowMajorBit,
SrcIsRowMajor = SrcFlags&RowMajorBit,
StorageOrdersAgree = (int(DstIsRowMajor) == int(SrcIsRowMajor)),
MightVectorize = StorageOrdersAgree
&& (int(DstFlags) & int(SrcFlags) & ActualPacketAccessBit)

View File

@ -85,7 +85,7 @@ struct traits<Product<Lhs, Rhs, Option> >
#endif
// The storage order is somewhat arbitrary here. The correct one will be determined through the evaluator.
Flags = ( MaxRowsAtCompileTime==1
Flags = ( (MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1)
|| ((LhsTraits::Flags&NoPreferredStorageOrderBit) && (RhsTraits::Flags&RowMajorBit))
|| ((RhsTraits::Flags&NoPreferredStorageOrderBit) && (LhsTraits::Flags&RowMajorBit)) )
? RowMajorBit : (MaxColsAtCompileTime==1 ? 0 : NoPreferredStorageOrderBit)

View File

@ -30,13 +30,15 @@ std::string demangle_unrolling(int t)
std::string demangle_flags(int f)
{
std::string res;
if(f&RowMajorBit) res += " | RowMajor";
if(f&PacketAccessBit) res += " | Packet";
if(f&LinearAccessBit) res += " | Linear";
if(f&LvalueBit) res += " | Lvalue";
if(f&DirectAccessBit) res += " | Direct";
if(f&AlignedBit) res += " | Aligned";
if(f&NestByRefBit) res += " | NestByRef";
if(f&RowMajorBit) res += " | RowMajor";
if(f&PacketAccessBit) res += " | Packet";
if(f&LinearAccessBit) res += " | Linear";
if(f&LvalueBit) res += " | Lvalue";
if(f&DirectAccessBit) res += " | Direct";
if(f&AlignedBit) res += " | Aligned";
if(f&NestByRefBit) res += " | NestByRef";
if(f&NoPreferredStorageOrderBit) res += " | NoPreferredStorageOrderBit";
return res;
}