diff --git a/src/KOKKOS/atom_vec_kokkos.h b/src/KOKKOS/atom_vec_kokkos.h index 0474a2380ae..2111e732080 100644 --- a/src/KOKKOS/atom_vec_kokkos.h +++ b/src/KOKKOS/atom_vec_kokkos.h @@ -153,15 +153,7 @@ class AtomVecKokkos : public AtomVec { buffer = Kokkos::kokkos_realloc(buffer,src.span()); buffer_size = src.span(); } - return mirror_type( buffer , - src.extent(0) , - src.extent(1) , - src.extent(2) , - src.extent(3) , - src.extent(4) , - src.extent(5) , - src.extent(6) , - src.extent(7) ); + return mirror_type(buffer, src.d_view.layout()); } template @@ -179,15 +171,8 @@ class AtomVecKokkos : public AtomVec { buffer = Kokkos::kokkos_realloc(buffer,src.span()*sizeof(typename ViewType::value_type)); buffer_size = src.span(); } - mirror_type tmp_view( (typename ViewType::value_type*)buffer , - src.extent(0) , - src.extent(1) , - src.extent(2) , - src.extent(3) , - src.extent(4) , - src.extent(5) , - src.extent(6) , - src.extent(7) ); + mirror_type tmp_view((typename ViewType::value_type*)buffer, src.d_view.layout()); + if(space == Device) { Kokkos::deep_copy(LMPHostType(),tmp_view,src.h_view), Kokkos::deep_copy(LMPHostType(),src.d_view,tmp_view);