Fix Eigen >= 3.3 compilation if EIGEN_DONT_VECTORIZE set

Would result in compilation error

include/ceres/jet.h:296:59: error: requested alignment is not a positive power of 2
   alignas(kAlignment) Eigen::Matrix<T, N, 1, kAlignOrNot> v;

because CERES_JET_ALIGN_BYTES = EIGEN_MAX_ALIGN_BYTES = 0 in that case.

Change-Id: I247653d3b7555e80891d3fb78676acfa302a9e1d
This commit is contained in:
Janick Martinez Esturo
2018-01-12 17:17:14 +01:00
parent 579c9afc51
commit c2da96082b
+1 -1
View File
@@ -258,7 +258,7 @@ struct Jet {
// supported is < 16, in which case we do not specify an alignment, as this // supported is < 16, in which case we do not specify an alignment, as this
// implies the host is not a modern x86 machine. If using < C++11, we cannot // implies the host is not a modern x86 machine. If using < C++11, we cannot
// specify alignment. // specify alignment.
#ifndef CERES_USE_CXX11 #if !defined(CERES_USE_CXX11) || defined(EIGEN_DONT_VECTORIZE)
// Without >= C++11, we cannot specify the alignment so fall back to safe, // Without >= C++11, we cannot specify the alignment so fall back to safe,
// unvectorised version. // unvectorised version.
Eigen::Matrix<T, N, 1, Eigen::DontAlign> v; Eigen::Matrix<T, N, 1, Eigen::DontAlign> v;