From: Daniel Arndt Date: Tue, 5 Jun 2018 22:08:43 +0000 (+0200) Subject: Fix compile error with CUDA 9.2 X-Git-Tag: v9.1.0-rc1~1074^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6712%2Fhead;p=dealii.git Fix compile error with CUDA 9.2 --- diff --git a/include/deal.II/matrix_free/cuda_matrix_free.templates.h b/include/deal.II/matrix_free/cuda_matrix_free.templates.h index 0600dae07d..3bfc11dfcb 100644 --- a/include/deal.II/matrix_free/cuda_matrix_free.templates.h +++ b/include/deal.II/matrix_free/cuda_matrix_free.templates.h @@ -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 =