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


## Input Parameter

- ***v -*** the vector



## Output Parameter

- ***a -*** the CUDA pointer.





## Notes
See `VecCUDAGetArray()` for data movement semantics of this function.

This function assumes that the user will not modify the vector data. This is analgogous to
intent(in) in Fortran.

The device pointer must be restored by calling `VecCUDARestoreArrayRead()`. If the data on the
host side was previously up to date it will remain so, i.e. data on both the device and the
host is up to date. Accessing data on the host side does not incur a device to host data
transfer.


## See Also
 [](ch_vectors), `VecCUDARestoreArrayRead()`, `VecCUDAGetArray()`, `VecCUDAGetArrayWrite()`, `VecGetArray()`,
`VecGetArrayRead()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/seq/cupm/cuda/vecseqcupm.cu.html#VecCUDAGetArrayRead">src/vec/vec/impls/seq/cupm/cuda/vecseqcupm.cu</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex47cu.cu.html">src/snes/tutorials/ex47cu.cu</A><BR>


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


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