]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix a warning when compiling with cuda support 14049/head
authorMatthias Maier <tamiko@43-1.org>
Sun, 26 Jun 2022 05:37:35 +0000 (00:37 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sun, 26 Jun 2022 05:37:35 +0000 (00:37 -0500)
dealii/include/deal.II/matrix_free/cuda_matrix_free.templates.h:1027:17:
    warning: loop variable ‘cell’ creates a copy from type ‘const
    dealii::TriaActiveIterator<dealii::CellAccessor<3, 3> >’
    [-Wrange-loop-construct]
dealii/include/deal.II/matrix_free/cuda_matrix_free.templates.h:1027:17:
    note: use reference type to prevent copying
 1027 |                 for (const auto cell :
      |                 ^~~~
      |                 &

include/deal.II/matrix_free/cuda_matrix_free.templates.h

index 12b7bbf039640e65a550d0b89bce9962ff3485d7..fd6f41d00a081f8757228ab6844036bcc8300cb8 100644 (file)
@@ -1024,7 +1024,7 @@ namespace CUDAWrappers
                 std::vector<bool> ghost_vertices(
                   dof_handler->get_triangulation().n_vertices(), false);
 
-                for (const auto cell :
+                for (const auto &cell :
                      dof_handler->get_triangulation().active_cell_iterators())
                   if (cell->is_ghost())
                     for (unsigned int i = 0;

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.