Re: [eigen] Alignment issues

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



Another frequent issue is a non-aligned stack when using, for instance, DLLs or multi-threading. In C++03, some member functions of the STL passed templated arguments by value instead of const reference, but I guess this has been fixed in C++11.

I myself often use EIGEN_DONT_ALIGN_STATICALLY when I don't care about ultimate performance. Alignment is still a pain.

gael


On Thu, Feb 13, 2014 at 3:11 PM, Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
On 13.02.2014 15:01, Christoph Hertzberg wrote:
On 13.02.2014 14:42, Nicola Gigante wrote:
In fact, code that you warn the user about in the documentation seems
to actually work in the same way:
class B {
     char c;
     Vector4f a;
};

With the above, could you try:

#include <vector>
#include <iostream>

int main() {
     B* b = new B;
     B* b_arr = new B[10];
     std::vector<B> b_vec(10);

     std::cout << b << "\n" << b_arr << "\n" << b_vec.data() << std::endl;
}

These are basically the things that used to get wrong. Maybe those have
been fixed by now, but they all fail on my gcc4.7 and clang3.1 on 32bit
Linux.
gcc does not even like the alignas(16) syntax (clang accepts it, but it
does not influence the outcome).

Addendum:
Gael reported a bug related to that here:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53900
The conclusion was that this is rather a bug in libstdc++ (still we need to work-around it)


Christoph




--
----------------------------------------------
Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: +49 (421) 218-64252
----------------------------------------------





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