# VecCreateSeqHIPWithArray
Creates a HIP sequential array-style vector, where the user provides the array space to store the vector values. The array provided must be a GPU array. 
## Synopsis
```
#include <petscvec.h> 
PetscErrorCode VecCreateSeqHIPWithArray(MPI_Comm comm, PetscInt bs, PetscInt n, const PetscScalar array[], Vec *V)
```
Collective


## Input Parameters

- ***comm -*** the communicator, should be PETSC_COMM_SELF
- ***bs -*** the block size
- ***n -*** the vector length
- ***array -*** GPU memory where the vector elements are to be stored.



## Output Parameter

- ***V -*** 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 VecHIPPlaceArray() 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
 `VecCreateMPIHIPWithArray()`, `VecCreate()`, `VecDuplicate()`, `VecDuplicateVecs()`,
`VecCreateGhost()`, `VecCreateSeq()`, `VecHIPPlaceArray()`, `VecCreateSeqWithArray()`,
`VecCreateMPIWithArray()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/seq/seqhip/vechip.hip.cpp#VecCreateSeqHIPWithArray">src/vec/vec/impls/seq/seqhip/vechip.hip.cpp</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/impls/seq/seqhip/vechip.hip.cpp)


[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)  
