]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use shared_ptr for Partitioner in CUDAWrappers::MatrixFree 7476/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 27 Nov 2018 14:46:55 +0000 (15:46 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 27 Nov 2018 15:02:49 +0000 (16:02 +0100)
include/deal.II/matrix_free/cuda_hanging_nodes_internal.h
include/deal.II/matrix_free/cuda_matrix_free.h
include/deal.II/matrix_free/cuda_matrix_free.templates.h

index 4a4df3be8e28df1afc1289d7c083c39648aab858..b7d8e5d18a9595a6be7c597cf9c3982be89cb033 100644 (file)
@@ -61,7 +61,7 @@ namespace CUDAWrappers
       setup_constraints(
         std::vector<types::global_dof_index> &                    dof_indices,
         const CellIterator &                                      cell,
-        const std::unique_ptr<const Utilities::MPI::Partitioner> &partitioner,
+        const std::shared_ptr<const Utilities::MPI::Partitioner> &partitioner,
         unsigned int &                                            mask) const;
 
     private:
@@ -276,7 +276,7 @@ namespace CUDAWrappers
     HangingNodes<dim>::setup_constraints(
       std::vector<types::global_dof_index> &                    dof_indices,
       const CellIterator &                                      cell,
-      const std::unique_ptr<const Utilities::MPI::Partitioner> &partitioner,
+      const std::shared_ptr<const Utilities::MPI::Partitioner> &partitioner,
       unsigned int &                                            mask) const
     {
       mask                         = 0;
index a8932d9b327a7ae35b69a8d6538b4abcffeb4bea..5c57033113bfdc706ab009e129560cb83fedd179 100644 (file)
@@ -428,10 +428,10 @@ namespace CUDAWrappers
     std::vector<dim3> block_dim;
 
     /**
-     * Unique pointer to a Partitioner for distributed Vectors used in
+     * Shared pointer to a Partitioner for distributed Vectors used in
      * cell_loop. When MPI is not used the pointer is null.
      */
-    std::unique_ptr<const Utilities::MPI::Partitioner> partitioner;
+    std::shared_ptr<const Utilities::MPI::Partitioner> partitioner;
 
     // Parallelization parameters
     unsigned int cells_per_block;
index 9e8c5e35f56891cbb0f6e14facfa84cfae473fe5..23f84bf896d662e61031828e4e717a24fd77efd6 100644 (file)
@@ -23,7 +23,6 @@
 
 #  include <deal.II/base/cuda_size.h>
 #  include <deal.II/base/graph_coloring.h>
-#  include <deal.II/base/std_cxx14/memory.h>
 
 #  include <deal.II/dofs/dof_tools.h>
 
@@ -147,7 +146,7 @@ namespace CUDAWrappers
       get_cell_data(
         const CellFilter &                                        cell,
         const unsigned int                                        cell_id,
-        const std::unique_ptr<const Utilities::MPI::Partitioner> &partitioner);
+        const std::shared_ptr<const Utilities::MPI::Partitioner> &partitioner);
 
       void
       alloc_and_copy_arrays(const unsigned int cell);
@@ -287,7 +286,7 @@ namespace CUDAWrappers
     ReinitHelper<dim, Number>::get_cell_data(
       const CellFilter &                                        cell,
       const unsigned int                                        cell_id,
-      const std::unique_ptr<const Utilities::MPI::Partitioner> &partitioner)
+      const std::shared_ptr<const Utilities::MPI::Partitioner> &partitioner)
     {
       cell->get_dof_indices(local_dof_indices);
       // When using MPI, we need to transform the local_dof_indices, which
@@ -843,7 +842,7 @@ namespace CUDAWrappers
       {
         DoFTools::extract_locally_relevant_dofs(dof_handler,
                                                 locally_relevant_dofs);
-        partitioner = std_cxx14::make_unique<Utilities::MPI::Partitioner>(
+        partitioner = std::make_shared<Utilities::MPI::Partitioner>(
           dof_handler.locally_owned_dofs(), locally_relevant_dofs, *comm);
       }
     for (unsigned int i = 0; i < n_colors; ++i)

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.