petsc-3.7.7 2017-09-25
Report Typos and Errors

VecCUSPGetArrayWrite

Provides write access to the CUSP device vector inside a vector.

Synopsis

PETSC_EXTERN PetscErrorCode VecCUSPGetArrayWrite(Vec v, CUSPARRAY **a)
The data pointed to by the device vector is uninitialized. The user must not read this data. Furthermore, the entire array needs to be filled by the user to obtain well-defined behaviour. The device memory will be allocated by this function if it hasn't been allocated previously. This is analogous to intent(out) in Fortran.

The CUSP device vector needs to be released with VecCUSPRestoreArrayWrite(). When the pointer is released the host data of the vector is marked as out of data. Subsequent access of the host data with e.g. VecGetArray() incurs a device to host data transfer.

Input Parameter

v -the vector

Output Parameter

a -the CUDA pointer

Fortran note

This function is not currently available from Fortran.

See Also

VecCUSPRestoreArrayWrite(), VecCUSPGetArrayReadWrite(), VecCUSPGetArrayRead(), VecCUSPGetArrayWrite(), VecGetArray(), VecGetArrayRead()

Level:intermediate
Location:
src/vec/vec/impls/seq/seqcusp/veccusp2.cu
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages

Examples

src/snes/examples/tutorials/ex47cu.cu.html