:orphan: # VecCUDAReplaceArray Permanently replace the GPU array in a vector with a GPU array provided by the user. ## Synopsis ``` #include PetscErrorCode VecCUDAReplaceArray(Vec vin, const PetscScalar a[]) ``` Not Collective; No Fortran Support ## Input Parameters - ***vec -*** the vector - ***array -*** the GPU array ## Notes This is useful to avoid copying a GPU array into a vector. This frees the memory associated with the old GPU array. The vector takes ownership of the passed array so it CANNOT be freed by the user. It will be freed when the vector is destroyed. ## See Also [](ch_vectors), `VecGetArray()`, `VecRestoreArray()`, `VecPlaceArray()`, `VecResetArray()`, `VecCUDAResetArray()`, `VecCUDAPlaceArray()`, `VecReplaceArray()` ## Level advanced ## Location src/vec/vec/impls/seq/cupm/cuda/vecseqcupm.cu --- [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)