From: Daniel Arndt Date: Wed, 7 Dec 2022 21:06:28 +0000 (+0000) Subject: Tests passing X-Git-Tag: v9.5.0-rc1~697^2~23 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0990b114ade6dc0f7e59b2ffc290f80a962d3d71;p=dealii.git Tests passing --- diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index d4910ca6ef..3b3beaafbe 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -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(result)); } }; } // namespace internal diff --git a/tests/lac/parallel_vector_21.cc b/tests/lac/parallel_vector_21.cc index 2f4e21c58c..a2eed7634c 100644 --- a/tests/lac/parallel_vector_21.cc +++ b/tests/lac/parallel_vector_21.cc @@ -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 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.