]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix compile error with CUDA 9.2 6712/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 5 Jun 2018 22:08:43 +0000 (00:08 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 5 Jun 2018 22:08:43 +0000 (00:08 +0200)
include/deal.II/matrix_free/cuda_matrix_free.templates.h

index 0600dae07d2da985446e613f92d097e52ad4277d..3bfc11dfcbfd6eaa26613c1996a1e23cb10752b6 100644 (file)
@@ -437,12 +437,16 @@ namespace CUDAWrappers
                        const Number *                               src,
                        Number *                                     dst)
     {
-      const unsigned int cells_per_block =
+      constexpr unsigned int cells_per_block =
         cells_per_block_shmem(dim, functor::n_dofs_1d - 1);
 
+      constexpr unsigned int n_dofs_per_block =
+        cells_per_block * functor::n_local_dofs;
+      constexpr unsigned int n_q_points_per_block =
+        cells_per_block * functor::n_q_points;
       // TODO make use of dynamically allocated shared memory
-      __shared__ Number values[cells_per_block * functor::n_local_dofs];
-      __shared__ Number gradients[dim][cells_per_block * functor::n_q_points];
+      __shared__ Number values[n_dofs_per_block];
+      __shared__ Number gradients[dim][n_q_points_per_block];
 
       const unsigned int local_cell = threadIdx.x / functor::n_dofs_1d;
       const unsigned int cell =

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.