Commit 04388c26 authored by Stan Moore's avatar Stan Moore
Browse files

Fix Kokkos view runtime issue

parent 7508660d
Loading
Loading
Loading
Loading
+3 −18
Original line number Diff line number Diff line
@@ -153,15 +153,7 @@ class AtomVecKokkos : public AtomVec {
       buffer = Kokkos::kokkos_realloc<Kokkos::CudaHostPinnedSpace>(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<class ViewType>
@@ -179,15 +171,8 @@ class AtomVecKokkos : public AtomVec {
       buffer = Kokkos::kokkos_realloc<Kokkos::CudaHostPinnedSpace>(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);