From: Daniel Arndt Date: Thu, 29 Oct 2020 19:29:09 +0000 (-0400) Subject: Fix multiple definitions for CUDAWrappes::internal::used_objects X-Git-Tag: v9.3.0-rc1~952^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55a381d1854b0d25ec5fb4f1b287f8bd17a6b4c8;p=dealii.git Fix multiple definitions for CUDAWrappes::internal::used_objects --- 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 775808150f..693016f66a 100644 --- a/include/deal.II/matrix_free/cuda_matrix_free.templates.h +++ b/include/deal.II/matrix_free/cuda_matrix_free.templates.h @@ -52,7 +52,7 @@ namespace CUDAWrappers (mf_max_elem_degree + 1) * (mf_max_elem_degree + 1); // Default initialized to false - std::array used_objects; + extern std::array used_objects; template using DataArray = NumberType[data_array_size]; diff --git a/source/matrix_free/cuda_matrix_free.cu b/source/matrix_free/cuda_matrix_free.cu index 52aee019b9..9bd1a0a52d 100644 --- a/source/matrix_free/cuda_matrix_free.cu +++ b/source/matrix_free/cuda_matrix_free.cu @@ -19,8 +19,15 @@ DEAL_II_NAMESPACE_OPEN + + namespace CUDAWrappers { + namespace internal + { + extern std::array used_objects; + } + // Do not instantiate for dim = 1 template class MatrixFree<2, float>; template class MatrixFree<2, double>;