]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Tests passing
authorDaniel Arndt <arndtd@ornl.gov>
Wed, 7 Dec 2022 21:06:28 +0000 (21:06 +0000)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 8 Dec 2022 22:13:15 +0000 (17:13 -0500)
include/deal.II/lac/la_parallel_vector.templates.h
tests/lac/parallel_vector_21.cc

index d4910ca6ef3d6e442e8ad1b4405e78916c2758e4..3b3beaafbee3ab1d7d34040ba0bc1a6938e07711 100644 (file)
@@ -480,9 +480,9 @@ namespace LinearAlgebra
               ::dealii::MemorySpace::Device::kokkos_space::execution_space>(
               exec, 0, size),
             KOKKOS_LAMBDA(size_type i, RealType & update) {
-              update += Kokkos::abs(data.values(i));
+              update = Kokkos::max(update, Kokkos::abs(data.values(i)));
             },
-            result);
+           Kokkos::Max<RealType, Kokkos::HostSpace>(result));
         }
       };
     } // namespace internal
index 2f4e21c58cfa2f12b5aa5e2659cf14d18c78c07b..a2eed7634ceb9ffe19525aab808b34130126a170 100644 (file)
@@ -50,9 +50,10 @@ test()
   v2.reinit(v, true);
 
   // set locally owned range of v2 manually
-  Kokkos::parallel_for(v2.local_size(), KOKKOS_LAMBDA(int i) {v2.get_values()[i] = 1.;});
-  Kokkos::fence();
+  Kokkos::View<double*, MemorySpace::Device::kokkos_space> v2_view(v2.get_values(), v2.local_size());
+  Kokkos::deep_copy(v2_view, 1.);
 
+  Kokkos::parallel_for(v2.local_size(), KOKKOS_LAMBDA(int i) { KOKKOS_IMPL_DO_NOT_USE_PRINTF("%d: %f\n", i, v2_view(i));});
   // add entries to ghost values
   // Because of limitation in import, the IndexSet of the ReadWriteVector needs
   // to have the local elements.

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.