Re: [eigen] Indexes: why signed instead of unsigned?

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




On Mon, May 17, 2010 at 1:39 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> c.block(1,12,50,89) += a.block(7,3,50,89) + b.block(70,35,50,89);
>
> it seems that GCC fails at generating good code and issue 3 imull in the
> most inner vectorized loop. The non vectorized loops (to deal with
> boundaries or when vectorization is disabled) are fine though... ahhhh
> compiler weirdnesses....


this is past :)

 The fix is to cache the outer size in Block just like we cache the address of the fist coeff. Actually, it seems it does not like when m_xpr.whatever() is used to compute the address since it does not detect the returned value is constant trough the loop... So for each memory access, it read the actual number of rows of the nested matrix from memory, and multiplied it to the outer index, etc.... just like Matrix::rows was volatile. As a result, 0.58s versus 0..9s for the above _expression_ (repeated a large number of time of course !)

Of course, the same might appear in some other contexts...

gael


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