Alignment on 16 bytes, whereas AVX requires 32?
Submitted by Thijs Withaar
Assigned to Nobody
Link to original bugzilla bug (#1331)
Version: 3.3 (current stable)
Operating system: Windows
Description
Using Eigen 3.3rc1 on windows 7, 64 bit with Visual Studio 2013,
and /arch:AVX
In:
Eigen\src\Core\util\Macros.h
EIGEN_IDEAL_MAX_ALIGN_BYTES is defined as 32 when AVX is enabled.
Somehow in
Eigen\src\Core\util\Memory.h,
aligned_malloc() still takes the code path given by EIGEN_MALLOC_ALREADY_ALIGNED
which results in 16-byte aligned memory.
This results in a crash in an line like
Eigen::VectorXd x = Eigen::VectorXd::Zero(n)
which traces down to a pstore.
Could it be that line 52 of Memory.h should read:
|| (EIGEN_OS_WIN64 && (EIGEN_DEFAULT_ALIGN_BYTES == EIGEN_IDEAL_MAX_ALIGN_BYTES)) \
instead of:
|| (EIGEN_OS_WIN64 && (EIGEN_DEFAULT_ALIGN_BYTES == 16)) \