From 6c3c904f310e75c94807940e570afd987db15534 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 29 Jul 2019 22:12:48 +0000 Subject: [PATCH] Fix compiling with CUDA --- cmake/checks/check_01_cpu_features.cmake | 9 +++++++++ include/deal.II/base/config.h.in | 9 +-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cmake/checks/check_01_cpu_features.cmake b/cmake/checks/check_01_cpu_features.cmake index b36f8e7cc0..6ed6d6b64c 100644 --- a/cmake/checks/check_01_cpu_features.cmake +++ b/cmake/checks/check_01_cpu_features.cmake @@ -290,6 +290,15 @@ IF(DEAL_II_HAVE_ALTIVEC) SET(DEAL_II_COMPILER_VECTORIZATION_LEVEL 1) ENDIF() +# +# We need to disable SIMD vectorization for CUDA device code. +# Otherwise, nvcc compilers from version 9 on will emit an error message like: +# "[...] contains a vector, which is not supported in device code" +# + +IF(DEAL_II_WITH_CUDA) + SET(DEAL_II_COMPILER_VECTORIZATION_LEVEL 0) +ENDIF() # # If we have OpenMP SIMD support (i.e. DEAL_II_HAVE_OPENMP_SIMD is true) diff --git a/include/deal.II/base/config.h.in b/include/deal.II/base/config.h.in index a86966b272..18c4f7ecb1 100644 --- a/include/deal.II/base/config.h.in +++ b/include/deal.II/base/config.h.in @@ -116,14 +116,7 @@ */ #cmakedefine DEAL_II_WORDS_BIGENDIAN -// We need to disable SIMD vectorization for CUDA device code. -// Otherwise, nvcc compilers from version 9 on will emit an error message like: -// "[...] contains a vector, which is not supported in device code" -#ifdef DEAL_II_WITH_CUDA -# define DEAL_II_COMPILER_VECTORIZATION_LEVEL 0 -#else -# define DEAL_II_COMPILER_VECTORIZATION_LEVEL @DEAL_II_COMPILER_VECTORIZATION_LEVEL@ -#endif +#define DEAL_II_COMPILER_VECTORIZATION_LEVEL @DEAL_II_COMPILER_VECTORIZATION_LEVEL@ #define DEAL_II_OPENMP_SIMD_PRAGMA @DEAL_II_OPENMP_SIMD_PRAGMA@ -- 2.39.5