Returns a Kokkos View that contains the array of a vector in the specified memory space.


template <class MemorySpace>
PetscErrorCode VecGetKokkosViewWrite(Vec, Kokkos::View<PetscScalar *, MemorySpace> *)


#include <petscvec_kokkos.hpp>
PetscErrorCode VecGetKokkosViewWrite  (Vec v,Kokkos::View<PetscScalar*,MemorySpace>* kv);

Logically Collective, No Fortran Support

Input Parameter#

Output Parameter#

  • kv - the Kokkos View with a user-specified template parameter MemorySpace


If the vector is not of type VECKOKKOS, an error will be raised.

The functions is similar to VecGetArrayWrite(). The returned view might contain garbage data or stale data and one is not expected to read data from the View. Instead, one is expected to overwrite all data in the View. One must return the View by a matching VecRestoreKokkosViewWrite() after finishing using the View.

Currently, only two memory spaces are supported: Kokkos::HostSpace and Kokkos::DefaultExecutionSpace::memory_space.

See Also#

VecRestoreKokkosViewWrite(), VecRestoreKokkosView(), VecGetKokkosView(), VecRestoreArray(), VecGetArrayRead(), VecGetArrays(), VecGetArrayF90(), VecGetArrayReadF90(), VecPlaceArray(), VecGetArray2d(), VecGetArrayPair(), VecRestoreArrayPair(), VecGetArrayWrite(), VecRestoreArrayWrite()





Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages