# VecCreateMPIKokkosWithArray
Creates a parallel, array-style vector, where the user provides the GPU array space to store the vector values. 
## Synopsis
```
PetscErrorCode VecCreateMPIKokkosWithArray(MPI_Comm comm, PetscInt bs, PetscInt n, PetscInt N, const PetscScalar darray[], Vec *v)
```
Collective


## Input Parameters

- ***comm  -*** the MPI communicator to use
- ***bs    -*** block size, same meaning as VecSetBlockSize()
- ***n     -*** local vector length, cannot be PETSC_DECIDE
- ***N     -*** global vector length (or PETSC_DECIDE to have calculated)
- ***array -*** the user provided GPU array to store the vector values



## Output Parameter

- ***vv -*** the vector



## Notes
Use VecDuplicate() or VecDuplicateVecs() to form additional vectors of the
same type as an existing vector.

If the user-provided array is NULL, then VecKokkosPlaceArray() can be used
at a later stage to SET the array for storing the vector values.

PETSc does NOT free the array when the vector is destroyed via VecDestroy().
The user should not free the array until the vector is destroyed.




## See Also
 `VecCreateSeqKokkosWithArray()`, `VecCreateMPIWithArray()`, `VecCreateSeqWithArray()`,
`VecCreate()`, `VecDuplicate()`, `VecDuplicateVecs()`, `VecCreateGhost()`,
`VecCreateMPI()`, `VecCreateGhostWithArray()`, `VecPlaceArray()`


## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/mpi/kokkos/mpikok.kokkos.cxx.html#VecCreateMPIKokkosWithArray">src/vec/vec/impls/mpi/kokkos/mpikok.kokkos.cxx</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/impls/mpi/kokkos/mpikok.kokkos.cxx)


[Index of all Vec routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
