Replace deprecated Kokkos capacity() with span()

This commit is contained in:
Stan Moore 2019-03-07 10:23:17 -07:00
parent f0e48931e4
commit 0edc588458
2 changed files with 11 additions and 11 deletions

View File

@ -139,11 +139,11 @@ class AtomVecKokkos : public AtomVec {
Kokkos::CudaHostPinnedSpace,typename ViewType::memory_space>::type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > mirror_type;
if (buffer_size == 0) {
buffer = Kokkos::kokkos_malloc<Kokkos::CudaHostPinnedSpace>(src.capacity());
buffer_size = src.capacity();
} else if (buffer_size < src.capacity()) {
buffer = Kokkos::kokkos_realloc<Kokkos::CudaHostPinnedSpace>(buffer,src.capacity());
buffer_size = src.capacity();
buffer = Kokkos::kokkos_malloc<Kokkos::CudaHostPinnedSpace>(src.span());
buffer_size = src.span();
} else if (buffer_size < src.span()) {
buffer = Kokkos::kokkos_realloc<Kokkos::CudaHostPinnedSpace>(buffer,src.span());
buffer_size = src.span();
}
return mirror_type( buffer ,
src.extent(0) ,
@ -165,11 +165,11 @@ class AtomVecKokkos : public AtomVec {
Kokkos::CudaHostPinnedSpace,typename ViewType::memory_space>::type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > mirror_type;
if (buffer_size == 0) {
buffer = Kokkos::kokkos_malloc<Kokkos::CudaHostPinnedSpace>(src.capacity()*sizeof(typename ViewType::value_type));
buffer_size = src.capacity();
} else if (buffer_size < src.capacity()) {
buffer = Kokkos::kokkos_realloc<Kokkos::CudaHostPinnedSpace>(buffer,src.capacity()*sizeof(typename ViewType::value_type));
buffer_size = src.capacity();
buffer = Kokkos::kokkos_malloc<Kokkos::CudaHostPinnedSpace>(src.span()*sizeof(typename ViewType::value_type));
buffer_size = src.span();
} else if (buffer_size < src.span()) {
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) ,

View File

@ -1074,7 +1074,7 @@ void memset_kokkos (ViewType &view) {
#ifndef KOKKOS_USING_DEPRECATED_VIEW
Kokkos::parallel_for(view.span()*sizeof(typename ViewType::value_type)/4, f);
#else
Kokkos::parallel_for(view.capacity()*sizeof(typename ViewType::value_type)/4, f);
Kokkos::parallel_for(view.span()*sizeof(typename ViewType::value_type)/4, f);
#endif
ViewType::execution_space::fence();
}