Deal with patched/un-patched version of householder_qr_inplace_blocked
parent
531ecb4000
commit
f61e398e2d
|
@ -205,6 +205,11 @@ if(GTSAM_USE_SYSTEM_EIGEN)
|
|||
|
||||
find_package(Eigen3 REQUIRED)
|
||||
include_directories(AFTER "${EIGEN3_INCLUDE_DIR}")
|
||||
|
||||
# check if MKL is also enabled - can have one or the other, but not both!
|
||||
if(EIGEN_USE_MKL_ALL)
|
||||
message(FATAL_ERROR "MKL cannot be used together with system-installed Eigen, as MKL support relies on patches which are not yet in the system-installed Eigen. Disable either GTSAM_USE_SYSTEM_EIGEN or GTSAM_WITH_EIGEN_MKL")
|
||||
endif()
|
||||
else()
|
||||
# Use bundled Eigen include path.
|
||||
set(GTSAM_EIGEN_INCLUDE_PREFIX "gtsam/3rdparty/Eigen/")
|
||||
|
|
|
@ -706,6 +706,7 @@ std::string formatMatrixIndented(const std::string& label, const Matrix& matrix,
|
|||
return ss.str();
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
void inplace_QR(Matrix& A){
|
||||
size_t rows = A.rows();
|
||||
size_t cols = A.cols();
|
||||
|
@ -716,7 +717,13 @@ void inplace_QR(Matrix& A){
|
|||
HCoeffsType hCoeffs(size);
|
||||
RowVectorType temp(cols);
|
||||
|
||||
#ifdef GTSAM_USE_SYSTEM_EIGEN
|
||||
// System-Eigen is used, and MKL is off
|
||||
Eigen::internal::householder_qr_inplace_blocked<Matrix, HCoeffsType>(A, hCoeffs, 48, temp.data());
|
||||
#else
|
||||
// Patched Eigen is used, and MKL is either on or off
|
||||
Eigen::internal::householder_qr_inplace_blocked<Matrix, HCoeffsType>::run(A, hCoeffs, 48, temp.data());
|
||||
#endif
|
||||
|
||||
zeroBelowDiagonal(A);
|
||||
}
|
||||
|
|
|
@ -42,6 +42,9 @@
|
|||
// Whether we are using TBB (if TBB was found and GTSAM_WITH_TBB is enabled in CMake)
|
||||
#cmakedefine GTSAM_USE_TBB
|
||||
|
||||
// Whether we are using system-Eigen or our own patched version
|
||||
#cmakedefine GTSAM_USE_SYSTEM_EIGEN
|
||||
|
||||
// Whether Eigen will use MKL (if MKL was found and GTSAM_WITH_EIGEN_MKL is enabled in CMake)
|
||||
#cmakedefine GTSAM_USE_EIGEN_MKL
|
||||
#cmakedefine EIGEN_USE_MKL_ALL // This is also defined in gtsam_eigen_includes.h
|
||||
|
|
Loading…
Reference in New Issue