petsc-3.15.0 2021-03-30
Report Typos and Errors

# VecGetArrayAndMemType

Like VecGetArray(), but if this is a GPU vector and it is currently offloaded to GPU, the returned pointer will be a GPU pointer to the GPU memory that contains this processor's portion of the vector data. Otherwise, it functions as VecGetArray().

### Synopsis

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

Logically Collective on Vec

### Input Parameter

| x | - the vector

### Output Parameters

| a | - location to put pointer to the array
| mtype | - memory type of the array

### See Also

VecRestoreArrayAndMemType(), VecRestoreArrayAndMemType(), VecRestoreArray(), VecGetArrayRead(), VecGetArrays(), VecGetArrayF90(), VecGetArrayReadF90(),
VecPlaceArray(), VecGetArray2d(), VecGetArrayPair(), VecRestoreArrayPair(), VecGetArrayWrite(), VecRestoreArrayWrite()

### Level

beginner

### Location

src/vec/vec/interface/rvector.c

### Implementations

VecGetArrayAndMemType_SeqCUDA in src/vec/vec/impls/seq/seqcuda/veccuda.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages