[eigen] Eigen on an arm core

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


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/