:orphan: # VecGetKokkosViewWrite Returns a Kokkos View that contains the array of a vector in the specified memory space. ## Synopsis ``` template PetscErrorCode VecGetKokkosViewWrite(Vec, Kokkos::View *) ``` ## Synopsis ``` #include PetscErrorCode VecGetKokkosViewWrite (Vec v,Kokkos::View* kv); ``` Logically Collective ## Input Parameter - ***v -*** the vector in type of `VECKOKKOS` ## Output Parameter - ***kv -*** the Kokkos View with a user-specified template parameter MemorySpace ## Notes 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()` ## Level beginner ## Location include/petscvec_kokkos.hpp --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscvec_kokkos.hpp) [Index of all Vec routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)