]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Disable SIMD vectorization in CUDA device code 7655/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 29 Jan 2019 22:23:50 +0000 (23:23 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 29 Jan 2019 22:41:54 +0000 (23:41 +0100)
include/deal.II/base/config.h.in

index 7801a2397f442f89ad6879046c01ed80173c70ed..9da0d4818f2e2a8c366a8edd7a989cd49ed6176e 100644 (file)
  */
 
 #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@
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.