Re: [eigen] Vectorization of complex

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


On 21.01.2011 13:02, Gael Guennebaud wrote:
> note that our matrix-matrix product kernel for complexes does not use
> this pmul function which is rather slow. The trick is to split the
> products between the real and imaginary part and combine them at the
> end of a series of mul-add.

BTW: Have you tried the "3-multiplication-trick" for complex matrix
multiplication yet:

(A+iB)*(C+iD) = AC - BD + i[(A+B)*(C+D) - AC - BD]

For big enough matrices this could give almost 25% performance gain --
at cost of little precision loss (could actually be quite large, e.g. if
the imaginary part is much smaller than the real part).

> Well this pmul function is actually used N^2 times for the
> multiplication with alpha. Recall that our kernel computes C += alpha
> * A * B, and even if you only do C = A*B this product with alpha is
> still there, taking alpha = 1.

Why? I admit this might be necessary in non-template libraries to
reduce/avoid code duplication, but I would have assumed that this can be
avoided by template specializations somehow (I have never checked your
multiplication-kernel though ...)

Christoph


-- 
----------------------------------------------
Dipl.-Inf. Christoph Hertzberg
Cartesium 0.051
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: (+49) 421-218-64252
----------------------------------------------



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