From: Daniel Arndt Date: Tue, 29 Jan 2019 22:23:50 +0000 (+0100) Subject: Disable SIMD vectorization in CUDA device code X-Git-Tag: v9.1.0-rc1~390^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=174fe8cce2d9ec68185227ea190274695160a3f4;p=dealii.git Disable SIMD vectorization in CUDA device code --- diff --git a/include/deal.II/base/config.h.in b/include/deal.II/base/config.h.in index 7801a2397f..9da0d4818f 100644 --- a/include/deal.II/base/config.h.in +++ b/include/deal.II/base/config.h.in @@ -114,7 +114,14 @@ */ #cmakedefine DEAL_II_WORDS_BIGENDIAN -#define DEAL_II_COMPILER_VECTORIZATION_LEVEL @DEAL_II_COMPILER_VECTORIZATION_LEVEL@ +// 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 __CUDA_ARCH__ +# define DEAL_II_COMPILER_VECTORIZATION_LEVEL 0 +#else +# define DEAL_II_COMPILER_VECTORIZATION_LEVEL @DEAL_II_COMPILER_VECTORIZATION_LEVEL@ +#endif #define DEAL_II_OPENMP_SIMD_PRAGMA @DEAL_II_OPENMP_SIMD_PRAGMA@