From a218074a2ce6921f616720cd54fd8130b9534737 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Tue, 25 Apr 2017 19:24:48 +0200 Subject: [PATCH] Add an error message regarding vectorization instruction set mismatch --- include/deal.II/base/vectorization.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index 5983ec7546..96e2d941d5 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -39,6 +39,16 @@ // 'check_01_cpu_features.cmake', ensures that these feature are not only // present in the compilation unit but also working properly. +#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && not defined(__SSE2__) +#error "Mismatch in vectorization capabilities: SSE2 was detected during configuration of deal.II and switched on, but it is apparently not available for the file you are trying to compile at the moment. Check compilation flags controlling the instruction set, such as -march=native." +#endif +#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && not defined(__AVX__) +#error "Mismatch in vectorization capabilities: AVX was detected during configuration of deal.II and switched on, but it is apparently not available for the file you are trying to compile at the moment. Check compilation flags controlling the instruction set, such as -march=native." +#endif +#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && not defined(__AVX512F__) +#error "Mismatch in vectorization capabilities: AVX-512F was detected during configuration of deal.II and switched on, but it is apparently not available for the file you are trying to compile at the moment. Check compilation flags controlling the instruction set, such as -march=native." +#endif + #if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 // AVX, AVX-512 #include #elif DEAL_II_COMPILER_VECTORIZATION_LEVEL == 1 // SSE2 -- 2.39.5