]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve default behaviour of CUDAWrappers::MatrixFree::reinit() 12985/head
authorPeter Munch <peterrmuench@gmail.com>
Tue, 23 Nov 2021 09:29:43 +0000 (10:29 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Tue, 23 Nov 2021 09:29:43 +0000 (10:29 +0100)
include/deal.II/matrix_free/cuda_matrix_free.templates.h

index 4c64f02188259ed4d47f9aa91c94b0882b946197..fe34371727c812c84f40d4fc896d7fcb19fd8a26 100644 (file)
@@ -711,10 +711,13 @@ namespace CUDAWrappers
   MatrixFree<dim, Number>::get_data(unsigned int color) const
   {
     Data data_copy;
-    data_copy.q_points        = q_points[color];
+    if (q_points.size() > 0)
+      data_copy.q_points = q_points[color];
+    if (inv_jacobian.size() > 0)
+      data_copy.inv_jacobian = inv_jacobian[color];
+    if (JxW.size() > 0)
+      data_copy.JxW = JxW[color];
     data_copy.local_to_global = local_to_global[color];
-    data_copy.inv_jacobian    = inv_jacobian[color];
-    data_copy.JxW             = JxW[color];
     data_copy.id              = my_id;
     data_copy.n_cells         = n_cells[color];
     data_copy.padding_length  = padding_length;
@@ -898,7 +901,9 @@ namespace CUDAWrappers
     if (typeid(Number) == typeid(double))
       cudaDeviceSetSharedMemConfig(cudaSharedMemBankSizeEightByte);
 
-    const UpdateFlags &update_flags = additional_data.mapping_update_flags;
+    UpdateFlags update_flags = additional_data.mapping_update_flags;
+    if (update_flags & update_gradients)
+      update_flags |= update_JxW_values;
 
     if (additional_data.parallelization_scheme != parallel_over_elem &&
         additional_data.parallelization_scheme != parallel_in_elem)

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.