]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use create_mirror_view_and_copy
authorDaniel Arndt <arndtd@ornl.gov>
Wed, 28 Dec 2022 21:43:55 +0000 (22:43 +0100)
committerDaniel Arndt <arndtd@ornl.gov>
Wed, 28 Dec 2022 21:43:55 +0000 (22:43 +0100)
include/deal.II/lac/la_parallel_vector.templates.h

index 756b2d92b8b85ce2510812b346e6305b0f946962..c18a97f302b70dbfd6311d477abd04980169d7df 100644 (file)
@@ -405,13 +405,12 @@ namespace LinearAlgebra
             ::dealii::MemorySpace::Default::kokkos_space{}, indices);
 
           // Move the data to the device
-          Kokkos::View<Number *, ::dealii::MemorySpace::Default::kokkos_space>
-            V_dev("V_dev", n_elements);
-          Kokkos::deep_copy(
-            exec,
-            V_dev,
-            Kokkos::View<Number *, Kokkos::HostSpace>(V.begin(), n_elements));
-          exec.fence();
+          Kokkos::View<Number *, Kokkos::HostSpace> V_view(V.begin(),
+                                                           n_elements);
+          Kokkos::View<Number *,
+                       ::dealii::MemorySpace::Default::kokkos_space> auto
+            V_dev = Kokkos::create_mirror_view_and_copy(
+              ::dealii::MemorySpace::Default::kokkos_space{}, V_view);
 
           // Set the values in tmp_vector
           Kokkos::parallel_for(

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.