Re: [eigen] unaligned or not unaligned vectorization ?

[ Thread Index | Date Index | More Archives ]

On Tue, Jul 8, 2008 at 12:37 PM, Benoît Jacob <jacob@xxxxxxxxxxxxxxx> wrote:
> Yes, too complicated. But what happened to the idea removing ei_pstoreu and in
> assignments, skip the first unaligned coeffs of the lhs (i.e. do them without
> vectorization?) The idea still looks good to me but I might have not
> understood something.

removing unaligned stores only corresponds to the U/A cases which are
still slower than without vectorization unless the "unaligned loads"
are actually aligned (probabily = 0.25). One option would be to add a
member function to all xpr checking at runtime all the arguments have
the same alignment.... maybe this test should be done in a per inner
vector manner. the evaluation would be:

for each outer vector j
 int offset = rhs.alignOffset(j);
 if offset >= 0 then
   perform offset non vectorized evaluations
   vectorized path
   perform remaining non vectorized evaluations
   call non vectorized path

of course this also apply for the linear path in which case it is
enough to query the first inner vector.

for instance the implementation of alignOffset(int j) of CwiseBinaryOp would be:

int offsetLhs = m_lhs.alignOffset();
int offsetRhs = m_rhs.alignOffset();
return offsetLhs == offsetRhs ? offsetLhs : -1;

what do you think ?


Mail converted by MHonArc 2.6.19+