VecGetArrayReadAndMemType#

Like VecGetArrayRead(), but if the input vector is a device vector, it will return a read-only device pointer. The returned pointer is guaranteed to point to up-to-date data. For host vectors, it functions as VecGetArrayRead().

Synopsis#

#include "petscvec.h"   
PetscErrorCode VecGetArrayReadAndMemType(Vec x, const PetscScalar **a, PetscMemType *mtype)

Not Collective; No Fortran Support

Input Parameter#

  • x - the vector

Output Parameters#

  • a - the array

  • mtype - memory type of the array

Notes#

The array must be returned using a matching call to VecRestoreArrayReadAndMemType().

See Also#

Vectors and Parallel Data, Vec, VecRestoreArrayReadAndMemType(), VecGetArrayAndMemType(), VecGetArrayWriteAndMemType(), VecGetArray(), VecRestoreArray(), VecGetArrayPair(), VecRestoreArrayPair(), VecGetArrayAndMemType()

Level#

beginner

Location#

src/vec/vec/interface/rvector.c


Edit on GitLab

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