:orphan:
# VecHIPGetArrayWrite
Provides write access to the HIP buffer inside a vector. 
## Synopsis
```
#include <petscvec.h> 
PetscErrorCode VecHIPGetArrayWrite(Vec v, PetscScalar **a)
```
Not Collective; Asynchronous; No Fortran Support


## Input Parameter

- ***v -*** the vector



## Output Parameter

- ***a -*** the HIP pointer





## Notes
The data pointed to by the device pointer is uninitialized. The user may not read from this
data. Furthermore, the entire array needs to be filled by the user to obtain well-defined
behaviour. The device memory will be allocated by this function if it hasn't been allocated
previously. This is analogous to intent(out) in Fortran.

The device pointer needs to be released with `VecHIPRestoreArrayWrite()`. When the pointer is
released the host data of the vector is marked as out of data. Subsequent access of the host
data with e.g. `VecGetArray()` incurs a device to host data transfer.


## See Also
 [](ch_vectors), `VecHIPRestoreArrayWrite()`, `VecHIPGetArray()`, `VecHIPGetArrayRead()`,
`VecHIPGetArrayWrite()`, `VecGetArray()`, `VecGetArrayRead()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/seq/cupm/hip/vecseqcupm.hip.cpp#VecHIPGetArrayWrite">src/vec/vec/impls/seq/cupm/hip/vecseqcupm.hip.cpp</A>


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


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