VecHIPGetArray#

Provides access to the device buffer inside a vector

Synopsis#

#include <petscvec.h> 
PetscErrorCode VecHIPGetArray(Vec v, PetscScalar **a)

Not Collective; Asynchronous; No Fortran Support

Input Parameter#

  • v - the vector

Output Parameter#

  • a - the device buffer

Notes#

This routine has semantics similar to VecGetArray(); the returned buffer points to a consistent view of the vector data. This may involve copying data from the host to the device if the data on the device is out of date. It is also assumed that the returned buffer is immediately modified, marking the host data out of date. This is similar to intent(inout) in Fortran.

If the user does require strong memory guarantees, they are encouraged to use VecHIPGetArrayRead() and/or VecHIPGetArrayWrite() instead.

The user must call VecHIPRestoreArray() when they are finished using the array.

Developer Note#

If the device memory hasn’t been allocated previously it will be allocated as part of this routine.

See Also#

Vectors and Parallel Data, VecHIPRestoreArray(), VecHIPGetArrayRead(), VecHIPGetArrayWrite(), VecGetArray(), VecGetArrayRead(), VecGetArrayWrite()

Level#

intermediate

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