From ae59a7652bae0727a983d586395bcaf2c48385cc Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 7 Dec 2018 09:23:28 +0100 Subject: [PATCH] bug #1638: add a warning if avx512 is enabled without SSE/AVX FMA --- Eigen/src/Core/util/ConfigureVectorization.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Eigen/src/Core/util/ConfigureVectorization.h b/Eigen/src/Core/util/ConfigureVectorization.h index 2ba0bab98..2584717b5 100644 --- a/Eigen/src/Core/util/ConfigureVectorization.h +++ b/Eigen/src/Core/util/ConfigureVectorization.h @@ -254,6 +254,13 @@ #define EIGEN_VECTORIZE_FMA #endif #if defined(__AVX512F__) + #ifndef __FMA__ + #if EIGEN_COMP_GNUC + #warning Please add -mfma to your compiler flags: compiling with -mavx512f alone without SSE/AVX FMA is not supported (bug 1638). + #else + #error Please enable FMA in your compiler flags (e.g. -mfma): compiling with AVX512 alone without SSE/AVX FMA is not supported (bug 1638). + #endif + #endif #define EIGEN_VECTORIZE_AVX512 #define EIGEN_VECTORIZE_AVX2 #define EIGEN_VECTORIZE_AVX