From ebf370595254ffb6b21d92bf5bfac0e97b2a6c2b Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 28 Dec 2022 22:43:50 +0100 Subject: [PATCH] Don't initialize Views --- include/deal.II/lac/la_parallel_vector.templates.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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 -- 2.39.5