VecHIPReplaceArray#

Permanently replace the GPU array in a vector with a GPU array provided by the user.

Synopsis#

#include <petscvec.h> 
PetscErrorCode VecHIPReplaceArray(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#

Vectors and Parallel Data, VecGetArray(), VecRestoreArray(), VecPlaceArray(), VecResetArray(), VecHIPResetArray(), VecHIPPlaceArray(), VecReplaceArray()

Level#

advanced

Location#

src/vec/vec/impls/seq/cupm/hip/vecseqcupm.hip.cpp


Edit on GitLab

Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages