Re: [eigen] Eigen on an arm core

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


Which version of Eigen and which compiler are you using?

We have since Eigen 2.0.1 a mechanism to disable alignment altogether
on platforms on which we don't vectorize anyway. That includes ARM.
However we have coded this mechanism only for GCC because we didn't
want to keep track of the different preprocessor symbols for all
compilers. Now if you're using a non-GCC compiler that's in common use
on ARM, it's worth supporting it here.

On another note, i'm not sure what causes this failure. It might be
the "wrong stack alignment" case,
http://eigen.tuxfamily.org/dox/WrongStackAlignment.html
but i'm not sure at all.

Benoit


2009/8/8 Daniel Stonier <d.stonier@xxxxxxxxx>:
> Hi,
>
> We threw eigen at an arm core recently running a SLAM algorithm and
> ignorantly discovered we were completely unknowing about alignment
> issues!
>
> I narrowed down our code to a simple example to hopefully highlight the issue:
>
> ************************************************************************************************
>
> #include <iostream>
> #include <vector>
> #include <Eigen/Array>
> #include <Eigen/Core>
>
> using std::vector;
> using Eigen::Vector2d;
> using Eigen::Vector3d;
> using Eigen::VectorXd;
>
> class A {
> public:
>     Vector2d v;
>
> };
>
> void f() {
>     A a;
>     double range = 3.0;
>     double bearing = 4.0;
>     a.v = Vector2d(range,bearing);
>     std::cout << a.v << std::endl;
> }
>
> int main() {
>     Vector3d v; // This is the spanner in the works, without this it runs fine.
>     f();
>
>     return 0;
> }
>
> ************************************************************************************************
>
> It then promptly drops out at the assert:
>
> ************************************************************************************************
>
> Eigen/src/Core/MatrixStorage.h:44: Eigen::ei_matrix_array<T, Size,
> MatrixOptions, Align>::ei_matrix_array() [with T = double, int Size =
> 2, int MatrixOptions = 2, bool Align = true]: Assertion
> `(reinterpret_cast<size_t>(array) & 0xf) == 0 && "this assertion is
> explained here:
> http://eigen.tuxfamily.org/dox/UnalignedArrayAssert.html  **** READ
> THIS WEB PAGE !!! ****"' failed.
>
> ************************************************************************************************
>
> I suspect...what we have is similar to the problem described for
> windows on mingw -
> http://eigen.tuxfamily.org/dox/WrongStackAlignment.html . I've been
> reading that the ARM series has some different alignment rules. Now
> I'm a bit dumbstruck about where to go with this or how to find out
> more about it. Do you have any tips?
>
> Regards,
> Daniel Stonier (Yujin Robot).
>
>
>



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