Re: [eigen] General questions about vectorization/alignment AGAIN

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


2011/1/17 hauke strasdat <strasdat@xxxxxxxxx>:
> Hi all,
>
> Once again thanks for developing such a great matrix library!
> Form the user's/programmer's view of Eigen3, vectorization/alignment
> is one of the most complicated issues. I very much appreciate the
> documentation you added which describes this issue in detail.
>
> I read through the documentation
> (http://eigen.tuxfamily.org/dox-devel/TopicUnalignedArrayAssert.html)
> and also skipped through the mailing list. Though, I still have a
> couple of open question which might also be of general interest.
>
> * It seems like that all issues regarding alignment only occur on
> 32-bit operation systems, right?

Depends on your operating system. Alignment issues only occur on
systems where the default malloc() does not already return 16-byte
aligned pointers.

malloc is 16-byte aligned at least in Win64, Linux x86-64, Mac OSX,
and FreeBSD 6+. Look at Core/util/Memory.h.

But there *may* theoretically exist 64bit OSes without a 16-byte
aligned malloc. Probably some unices.

> (Would be nice to add this info to
> http://eigen.tuxfamily.org/dox-devel/TopicUnalignedArrayAssert.html.

No interest in incitating users to write non-portable code.

>  Btw., which is the easiest way to test the code on a 64-bit OS? I
> used virtual box to setup a 32-bit OS. Is there an easier option?)

you can always override your system's default memory allocator. Or you
can explicitly construct objects at an unaligned location using
placement new or reinterpret_cast, that's what we do in the tests.

Benoit



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