:orphan: # VecGetKokkosView Returns a constant Kokkos View that contains up-to-date data of a vector in the specified memory space. ## Synopsis ``` template PetscErrorCode VecGetKokkosView(Vec, Kokkos::View *) ``` ## Synopsis ``` #include PetscErrorCode VecGetKokkosView (Vec v,Kokkos::View* kv); PetscErrorCode VecGetKokkosView (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 are similar to `VecGetArrayRead()` and `VecGetArray()` respectively. One can read-only or read/write the returned Kokkos View. Passing in a const View enables read-only access. One must return the View by a matching `VecRestoreKokkosView()` after finishing using the View. Currently, only two memory spaces are supported: Kokkos::HostSpace and Kokkos::DefaultExecutionSpace::memory_space. If needed, a memory copy will be internally called to copy the latest vector data to the specified memory space. ## See Also `VecRestoreKokkosView()`, `VecRestoreArray()`, `VecGetKokkosViewWrite()`, `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)