# MatDenseCUDARestoreArrayRead
Restore read-only access to the CUDA buffer inside a `MATDENSECUDA` matrix previously obtained with a call to `MatDenseCUDAGetArrayRead()`. 
## Synopsis
```
#include "petscmat.h"  
PetscErrorCode MatDenseCUDARestoreArrayRead(Mat A, const PetscScalar **a)
```
Not Collective


## Input Parameters

- ***A -*** the matrix
- ***array -*** the GPU array in column major order



## Note
Data can be copied to the GPU due to operations done on the CPU. If you need write only access, use `MatDenseCUDAGetArrayWrite()`.




## See Also
 `MATDENSECUDA`, `MatDenseCUDAGetArray()`, `MatDenseCUDARestoreArray()`, `MatDenseCUDARestoreArrayWrite()`, `MatDenseCUDAGetArrayWrite()`, `MatDenseCUDAGetArrayRead()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/mpi/mpidense.c.html#MatDenseCUDARestoreArrayRead">src/mat/impls/dense/mpi/mpidense.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/mpi/mpidense.c.html#MatDenseCUDARestoreArrayRead_MPIDenseCUDA">MatDenseCUDARestoreArrayRead_MPIDenseCUDA in src/mat/impls/dense/mpi/mpidense.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/seq/cuda/densecuda.cu.html#MatDenseCUDARestoreArrayRead_SeqDenseCUDA">MatDenseCUDARestoreArrayRead_SeqDenseCUDA in src/mat/impls/dense/seq/cuda/densecuda.cu</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/dense/mpi/mpidense.c)


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