From 9e553c57bf5f9734599bd70da49149358f115284 Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Thu, 2 Sep 2021 17:52:22 +0000 Subject: [PATCH] Fix size of data copied to constant memory and add missing include --- include/deal.II/matrix_free/cuda_matrix_free.templates.h | 4 +++- tests/cuda/cuda_vector_05.cu | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) 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 0d2fc60ad2..1bd8d75285 100644 --- a/include/deal.II/matrix_free/cuda_matrix_free.templates.h +++ b/include/deal.II/matrix_free/cuda_matrix_free.templates.h @@ -274,7 +274,9 @@ namespace CUDAWrappers cudaError_t error_code = cudaMemcpyToSymbol( constraint_weights, shape_info.data.front().subface_interpolation_matrix.data(), - sizeof(double) * fe.n_dofs_per_face(0) * fe.n_dofs_per_face(0)); + sizeof(double) * + shape_info.data.front().subface_interpolation_matrix.size()); + AssertCuda(error_code); local_dof_indices.resize(data->dofs_per_cell); lexicographic_dof_indices.resize(dofs_per_cell); diff --git a/tests/cuda/cuda_vector_05.cu b/tests/cuda/cuda_vector_05.cu index d11c598774..8c2dd8963d 100644 --- a/tests/cuda/cuda_vector_05.cu +++ b/tests/cuda/cuda_vector_05.cu @@ -18,6 +18,7 @@ #include #include +#include #include #include -- 2.39.5