Re: [eigen] a few more points...

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


On Sat, Jan 3, 2009 at 2:26 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
> 2009/1/3 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
>>>> and I don't think that's safe to add AlignedBit if we have
>>>> ForceAligned, eg:
>>>>
>>>> Matrix4d m1;
>>>> m1.block<2,2>(1,0) *= 2;
>>>>
>>>> will take the "LinearVectorization with CompleteUnrolling" path and crash.
>>>
>>> The block expression here doesn't have the LinearAccessBit because it
>>> isn't a vector. So this assignment shouldn't take the
>>> LinearVectorization path.
>>
>> right, so it will take the "InnerVectorization with CompleteUnrolling"
>> and still crash.
>
> ok, now I understand. But the point is, with code such as
>>>> Matrix4d m1;
>>>> m1.block<2,2>(1,0) *= 2;
> I would never have thought of using ForceAligned. But now I understand
> your explanation, there are other examples like you say where we want
> ForceAligned but not Aligned flag, like when one does aligned accesses
> in a non-aligned block.

actually, in that example ForceAligned is automatically set by Eigen,
but of course, for such a small block it is useless because the
vectorized path won't be taken. So just to make it clear, let's take
another example:

VectorXf a(1000), b(150);
a.segment(3,150) += b;

in that case, ForceAligned is still automatically set by Eigen for the
subvector of "a" (in MapBase) which allow to perform read operation
from a.segment(3,150) in an aligned fashion. This is because in
Assign.h we guarantee that store operations are always aligned.

---


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