]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Consider number of components in n_local_dofs 18042/head
authorPeter Munch <peterrmuench@gmail.com>
Tue, 28 Jan 2025 10:02:29 +0000 (11:02 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Tue, 28 Jan 2025 10:02:29 +0000 (11:02 +0100)
include/deal.II/matrix_free/portable_matrix_free.templates.h
include/deal.II/matrix_free/tools.h
tests/matrix_free_kokkos/matrix_vector_host_device_multi_component.cc

index 8685b3df7017908ed3a070662bc3aa952f2ab095..e8c760923bba468ad85b539a08fce66b1cc1caad 100644 (file)
@@ -367,9 +367,11 @@ namespace Portable
       size_t
       team_shmem_size(int /*team_size*/) const
       {
-        return SharedViewValues::shmem_size(Functor::n_local_dofs,
+        return SharedViewValues::shmem_size(Functor::n_local_dofs /
+                                              gpu_data.n_components,
                                             gpu_data.n_components) +
-               SharedViewGradients::shmem_size(Functor::n_local_dofs,
+               SharedViewGradients::shmem_size(Functor::n_local_dofs /
+                                                 gpu_data.n_components,
                                                dim,
                                                gpu_data.n_components);
       }
@@ -381,10 +383,11 @@ namespace Portable
       {
         // Get the scratch memory
         SharedViewValues    values(team_member.team_shmem(),
-                                Functor::n_local_dofs,
+                                Functor::n_local_dofs / gpu_data.n_components,
                                 gpu_data.n_components);
         SharedViewGradients gradients(team_member.team_shmem(),
-                                      Functor::n_local_dofs,
+                                      Functor::n_local_dofs /
+                                        gpu_data.n_components,
                                       dim,
                                       gpu_data.n_components);
 
index 5b3e15f5c9eadb93b8f984b4ae8b9a08a633dd79..988e6b6b4e81444a772e3fa3d19969ceb32e2a51 100644 (file)
@@ -1492,7 +1492,7 @@ namespace MatrixFreeTools
     };
 
     static constexpr unsigned int n_local_dofs =
-      dealii::Utilities::pow(fe_degree + 1, dim);
+      dealii::Utilities::pow(fe_degree + 1, dim) * n_components;
     static constexpr unsigned int n_q_points =
       dealii::Utilities::pow(n_q_points_1d, dim);
 
index 10639ffba53dd2547d222554a63fe9390026edd5..c5b892696696ec86ee178775ebabfd983dce8019 100644 (file)
@@ -198,9 +198,10 @@ public:
 
     phi.distribute_local_to_global(dst);
   }
-  static const unsigned int n_dofs_1d    = fe_degree + 1;
-  static const unsigned int n_local_dofs = Utilities::pow(fe_degree + 1, dim);
-  static const unsigned int n_q_points   = Utilities::pow(fe_degree + 1, dim);
+  static const unsigned int n_dofs_1d = fe_degree + 1;
+  static const unsigned int n_local_dofs =
+    Utilities::pow(fe_degree + 1, dim) * n_components;
+  static const unsigned int n_q_points = Utilities::pow(fe_degree + 1, dim);
 
 private:
   const unsigned int version;

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.