From: Daniel Arndt Date: Mon, 29 Jul 2019 22:12:48 +0000 (+0000) Subject: Fix compiling with CUDA X-Git-Tag: v9.2.0-rc1~1334^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8431%2Fhead;p=dealii.git Fix compiling with CUDA --- 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@