Re: [eigen] Clean aligned memory allocation

[ Thread Index | Date Index | More Archives ]

Note 16 byte alignment won't cut it for AVX, AVX2 nor the upcoming AVX512 (if CPUs supporting it ever ship)

-- Mark

On 02/02/2016 08:47 AM, Benoit Jacob wrote:

2016-02-02 7:29 GMT-05:00 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:

On Tue, Feb 2, 2016 at 1:59 AM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
it relies on the unsafe assumption that the memory allocator is a property of the platform and can thus be inferred from preprocessor checks.
That's not the case: many large applications use their own memory allocator, and that's a runtime property, not something that Eigen could detect at compile time.

Actually, in C++11, std::malloc is required to return pointers matching the alignment given by alignof(max_align_t)), which is 16 on most 64bits systems. This is a reliable information, and any malloc replacement would thus be required to honor this requirement.

Interesting, great to know that the problem is going away in C++11 or at least is being folded into something that we can rely on at compile time.
Not sure though what that means for us as long as we're not requiring compiling in C++11 mode.



Mail converted by MHonArc 2.6.19+