Re: [eigen] unaligned or not unaligned vectorization ? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] unaligned or not unaligned vectorization ?
- From: "Gael Guennebaud" <gael.guennebaud@xxxxxxxxx>
- Date: Tue, 8 Jul 2008 12:53:23 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=0l/TwcazXgDtsqEzv4d4q0bJqf9vtLj8Yj3jyOapags=; b=aSvKoDfGI6bp1n6YFne7d5Nw9Wa9WZvbJEmXKfVClO8InRQvUEHGqWC9IAGueRxeBN kGUh2yCPZ08jLzNCO7zeoxlIhm4FeP4H42HIJt9Mil0I5nJIYIYZrJqT4slrPycbeaVN WOuI8qi8cW46xYbofWSlqD+i2uK6KZGqvEpDM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=eXbzYwRpNl+Hd0XPtYvgyR07ii34SqlWY0U3q4GzEtuwikqKHdGlhYG8bwgfZoADB3 lvKK7TkVeZ1pJ/X1Wvui/EXHeX5dmuAkobbquAi6XlWPRbI99OCUhbvd0mrqCyld5A8+ 1XtIdA3dLE+nfT9RBIxRwWdAyALgAAeQNyLMQ=
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
else
call non vectorized path
endif
endfor
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 ?
gael.