Eigen alignment issues

Do the memory alignment issues with Eigen listed in the documentation still apply with C++11? It seems that C++11 can already take care of properly aligning objects on the stack and on the heap, with alignas and std::allocator which supports alignment.


Yes, the alignment issues are still present in C++11. The alignas specifier has no effect on dynamic allocations, which can thus still cause misalignments resulting in assertions thrown by Eigen.

You will have to continue to use the facilities Eigen provides for aligned allocation, such as EIGEN_MAKE_ALIGNED_OPERATOR_NEW for allocating objects or Eigen::aligned_allocator<T> for aligning containers.

链接地址: http://www.djcxy.com/p/25524.html

上一篇: 如何指定ElasticSearch副本

下一篇: 本征对齐问题