From: Daniel Arndt Date: Wed, 28 Dec 2022 21:43:50 +0000 (+0100) Subject: Don't initialize Views X-Git-Tag: v9.5.0-rc1~697^2~12 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebf370595254ffb6b21d92bf5bfac0e97b2a6c2b;p=dealii.git Don't initialize Views --- diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index f5ec0ad5ff..756b2d92b8 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -385,8 +385,9 @@ namespace LinearAlgebra const IndexSet & v_stored = V.get_stored_elements(); const size_type n_elements = v_stored.n_elements(); Kokkos::DefaultHostExecutionSpace host_exec; - Kokkos::View indices("indices", - n_elements); + Kokkos::View indices( + Kokkos::view_alloc(Kokkos::WithoutInitializing, "indices"), + n_elements); Kokkos::parallel_for( "import_elements: fill indices", Kokkos::RangePolicy(host_exec, @@ -400,11 +401,8 @@ namespace LinearAlgebra // Move the indices to the device ::dealii::MemorySpace::Default::kokkos_space::execution_space exec; - Kokkos::View - indices_dev("indices_dev", n_elements); - Kokkos::deep_copy(exec, indices_dev, indices); - exec.fence(); + auto indices_dev = Kokkos::create_mirror_view_and_copy( + ::dealii::MemorySpace::Default::kokkos_space{}, indices); // Move the data to the device Kokkos::View