[eigen] std::complex vectorization braindump

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi,

What i'm doing at the moment (HouseholderSequence stuff) is so boring
that I couldn't help thinking about std::complex vectorization. Here's
a braindump:
 - so i don't forget it
 - so someone else can get a chance to do it first (otherwise, i'll do
it after the SVD).

*** General problems ***

vectorizing std::complex breaks at least 2 assumptions that Eigen is
currently making:
1) that vectorized paths can assume real numbers
 ---> For example in Dot.h the vectorized paths don't bother conjugating
2) that PacketSize==1 means no vectorization
 ---> This breaks for complex<double>

 Also need to check if the low-level matrix-matrix product code makes
particular assumptions (?)

*** Steps ***

1) Everywhere in Eigen when we have PacketSize==1 conditions, examine
if we really mean that or if that is a way of asking if the scalar
type has vectorization. Hint: in 95% of cases it is the latter. An
exception might be in ei_first_aligned, need to check.

2) In ei_packet_traits introduce a new member enum Vectorizable and
use it everywhere that in 1) this is what was meant.

3) Introduce new SIMD functions ei_pconj (conjugate a packet) and
ei_pmulconj (compute x*conj(y), useful in dot products etc.).
For real numbers, ei_pconj(x) returns x and ei_pmulconj is just like
ei_pmul. Implement them for complex<float> and complex<double>. At
first, do it only for SSE using instructions like SHUFPS, then we'll
see if stuff can factor out with AltiVec...

4) Everywhere that we need to conjugate stuff, update the vectorized
paths to use ei_pconj and ei_pmulconj appropriately (at least in
Dot.h).

5) The puzzle: What to do about ei_pabs() ? In the same vein it would
be nice to introduce a ei_pabs2()... but we need to solve the
question: what should they return, a half of a packet of reals???

Benoit



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/