From 7077915ee6a57f7aee13f07eafb1b9783b8954ad Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 12 Jun 2023 19:33:42 -0400 Subject: [PATCH] Fix matrix_free_device tests for Trilinos 12.14.1 --- .../deal.II/matrix_free/cuda_fe_evaluation.h | 13 +++++ .../matrix_free/cuda_matrix_free.templates.h | 49 ++++++++++++++++--- .../matrix_free_device_no_index_initialize.cc | 12 +++++ 3 files changed, 67 insertions(+), 7 deletions(-) diff --git a/include/deal.II/matrix_free/cuda_fe_evaluation.h b/include/deal.II/matrix_free/cuda_fe_evaluation.h index ae1b6ed9ff..309468a78c 100644 --- a/include/deal.II/matrix_free/cuda_fe_evaluation.h +++ b/include/deal.II/matrix_free/cuda_fe_evaluation.h @@ -519,6 +519,19 @@ namespace CUDAWrappers [&](const int &i) { func(this, i); }); shared_data->team_member.team_barrier(); } + + + +#ifndef DOXYGEN + template + constexpr unsigned int + FEEvaluation:: + n_q_points; +#endif } // namespace CUDAWrappers DEAL_II_NAMESPACE_CLOSE 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 d23617a100..d76d9cd140 100644 --- a/include/deal.II/matrix_free/cuda_matrix_free.templates.h +++ b/include/deal.II/matrix_free/cuda_matrix_free.templates.h @@ -624,7 +624,12 @@ namespace CUDAWrappers "dealii::MatrixFree::evaluate_coeff", Kokkos::MDRangePolicy< MemorySpace::Default::kokkos_space::execution_space, - Kokkos::Rank<2>>(exec, {0, 0}, {n_cells[i], Functor::n_q_points}), + Kokkos::Rank<2>>( +#if KOKKOS_VERSION >= 20900 + exec, +#endif + {0, 0}, + {n_cells[i], Functor::n_q_points}), KOKKOS_LAMBDA(const int cell, const int q) { func(&color_data, cell, q); }); @@ -920,7 +925,12 @@ namespace CUDAWrappers MemorySpace::Default::kokkos_space::execution_space exec; Kokkos::TeamPolicy< MemorySpace::Default::kokkos_space::execution_space> - team_policy(exec, n_cells[color], Kokkos::AUTO); + team_policy( +#if KOKKOS_VERSION >= 20900 + exec, +#endif + n_cells[color], + Kokkos::AUTO); internal::ApplyKernel apply_kernel( func, get_data(color), src.get_values(), dst.get_values()); @@ -960,7 +970,12 @@ namespace CUDAWrappers { Kokkos::TeamPolicy< MemorySpace::Default::kokkos_space::execution_space> - team_policy(exec, n_cells[0], Kokkos::AUTO); + team_policy( +#if KOKKOS_VERSION >= 20900 + exec, +#endif + n_cells[0], + Kokkos::AUTO); internal::ApplyKernel apply_kernel( func, get_data(0), src.get_values(), dst.get_values()); @@ -978,7 +993,12 @@ namespace CUDAWrappers { Kokkos::TeamPolicy< MemorySpace::Default::kokkos_space::execution_space> - team_policy(exec, n_cells[1], Kokkos::AUTO); + team_policy( +#if KOKKOS_VERSION >= 20900 + exec, +#endif + n_cells[1], + Kokkos::AUTO); internal::ApplyKernel apply_kernel( func, get_data(1), src.get_values(), dst.get_values()); @@ -1001,7 +1021,12 @@ namespace CUDAWrappers { Kokkos::TeamPolicy< MemorySpace::Default::kokkos_space::execution_space> - team_policy(exec, n_cells[2], Kokkos::AUTO); + team_policy( +#if KOKKOS_VERSION >= 20900 + exec, +#endif + n_cells[2], + Kokkos::AUTO); internal::ApplyKernel apply_kernel( func, get_data(2), src.get_values(), dst.get_values()); @@ -1029,7 +1054,12 @@ namespace CUDAWrappers { Kokkos::TeamPolicy< MemorySpace::Default::kokkos_space::execution_space> - team_policy(exec, n_cells[i], Kokkos::AUTO); + team_policy( +#if KOKKOS_VERSION >= 20900 + exec, +#endif + n_cells[i], + Kokkos::AUTO); internal::ApplyKernel apply_kernel( func, get_data(i), src.get_values(), dst.get_values()); @@ -1061,7 +1091,12 @@ namespace CUDAWrappers { Kokkos::TeamPolicy< MemorySpace::Default::kokkos_space::execution_space> - team_policy(exec, n_cells[i], Kokkos::AUTO); + team_policy( +#if KOKKOS_VERSION >= 20900 + exec, +#endif + n_cells[i], + Kokkos::AUTO); internal::ApplyKernel apply_kernel( func, diff --git a/tests/matrix_free/matrix_free_device_no_index_initialize.cc b/tests/matrix_free/matrix_free_device_no_index_initialize.cc index 9ab2222c4f..86fc58e301 100644 --- a/tests/matrix_free/matrix_free_device_no_index_initialize.cc +++ b/tests/matrix_free/matrix_free_device_no_index_initialize.cc @@ -97,6 +97,18 @@ protected: const CUDAWrappers::MatrixFree &data; }; +template +const unsigned int + MatrixFreeTest::n_dofs_1d; + +template +const unsigned int + MatrixFreeTest::n_local_dofs; + +template +const unsigned int + MatrixFreeTest::n_q_points; + template -- 2.39.5