petsc-3.7.3 2016-08-01
Report Typos and Errors

VecCUSPGetCUDAArrayRead

Provides read access to the CUDA buffer inside a vector.

Synopsis

PETSC_EXTERN PetscErrorCode VecCUSPGetCUDAArrayRead(Vec v, PetscScalar **a)
This function is analogous to VecGetArrayRead(): The pointer returned by this function points to a consistent view of the vector data. This may involve a copy operation of data from the host to the device if the data on the device is out of date. If the device memory hasn't been allocated previously it will be allocated as part of this function call. VecCUSPGetCUDAArrayRead() assumes that the user will not modify the vector data. This is analgogous to intent(in) in Fortran.

The CUDA device pointer has to be released by calling VecCUSPRestoreCUDAArrayRead(). If the data on the host side was previously up to date it will remain so, i.e. data on both the device and the host is up to date. Accessing data on the host side does not incur 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

VecCUSPRestoreCUDAArrayRead(), VecCUSPGetCUDAArrayReadWrite(), VecCUSPGetCUDAArrayWrite(), VecCUSPGetArrayReadWrite(), VecCUSPGetArrayRead(), VecCUSPGetArrayWrite(), VecGetArray(), VecGetArrayRead()

Level:advanced
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