From 174fe8cce2d9ec68185227ea190274695160a3f4 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 29 Jan 2019 23:23:50 +0100 Subject: [PATCH] Disable SIMD vectorization in CUDA device code --- include/deal.II/base/config.h.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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@ -- 2.39.5