Re: [eigen] Alignment

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


2009/2/23 Rene Wagner <rw@xxxxxxxxxxxx>:
> Thanks for confirming. It might be worth adding that to the
> documentation to avoid further stupid questions on the subject ;)

Not stupid at all, but yes it's always useful to update the online docs.

> I agree it's not great, but since I don't call resize() it's good enough
> for me right now.

You'll also have to make sure that resize() doesn't get called
internally, and that depends on the implementation of the rest of
std::vector, so it's really incomfortable. E.g. even if you never
resize, one could imagine that in some impls, some constructor calls
resize() as a helper.

> boost::array uses a plain "on-the-stack" array internally. So, as far as
> storage is concerned
>
> boost::array<T,size> a;
>
> is equivalent to
>
> T a[size];

Ah, OK. Then i'm confident that you won't have any problems. No
"operator new" gets called here, it's all done at compile time, and
then what happens is that inside Eigen, we declare the arrays that
need it with 128-bit alignment (for example on GCC this gives
__attribute__((align(16))) ). This should propagate as needed, as the
compiler has all the information that's needed.

Cheers,
Benoit



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