]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Reorganize __syncthreads for hanging nodes 8693/head
authorDaniel Arndt <arndtd@ornl.gov>
Tue, 3 Sep 2019 19:35:43 +0000 (19:35 +0000)
committerDaniel Arndt <arndtd@ornl.gov>
Tue, 3 Sep 2019 19:35:43 +0000 (19:35 +0000)
include/deal.II/matrix_free/cuda_fe_evaluation.h
include/deal.II/matrix_free/cuda_hanging_nodes_internal.h

index 2bbc299a5cbec693cb06e5868888f25fed8c54cc..b2bb935ccfa457352bee0c4447edd6e00d16a1e7 100644 (file)
@@ -258,10 +258,10 @@ namespace CUDAWrappers
     // Use the read-only data cache.
     values[idx] = __ldg(&src[src_idx]);
 
+    __syncthreads();
+
     internal::resolve_hanging_nodes<dim, fe_degree, false>(constraint_mask,
                                                            values);
-
-    __syncthreads();
   }
 
 
index c30bb4e1ba7bde3378b2dacfadb1590be4dd0a2e..1560cbc7640b385e415b8bfd013b7b70c4dcf9ae 100644 (file)
@@ -782,7 +782,7 @@ namespace CUDAWrappers
           ((direction == 1) && ((constraint_mask & internal::constr_type_x) ?
                                   (x_idx == 0) :
                                   (x_idx == fe_degree)));
-        __syncthreads();
+
         if (constrained_face && constrained_dof)
           {
             const bool type = constraint_mask & this_type;
@@ -829,9 +829,10 @@ namespace CUDAWrappers
         // The synchronization is done for all the threads in one block with
         // each block being assigned to one element.
         __syncthreads();
-
         if (constrained_face && constrained_dof)
           values[index2<fe_degree + 1>(x_idx, y_idx)] = t;
+
+        __syncthreads();
       }
 
 
@@ -897,7 +898,6 @@ namespace CUDAWrappers
            ((constraint_mask & face2) && on_face2) ||
            ((constraint_mask & edge) && on_face1 && on_face2));
 
-        __syncthreads();
         if (constrained_face && constrained_dof)
           {
             const bool type = constraint_mask & this_type;
@@ -946,10 +946,14 @@ namespace CUDAWrappers
               }
           }
 
+        // The synchronization is done for all the threads in one block with
+        // each block being assigned to one element.
         __syncthreads();
 
         if (constrained_face && constrained_dof)
           values[index3<fe_degree + 1>(x_idx, y_idx, z_idx)] = t;
+
+        __syncthreads();
       }
     } // namespace internal
 

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.