#include "petscvec.h" PETSC_EXTERN PetscErrorCode VecViennaCLGetCLMemWrite(Vec v, PETSC_UINTPTR_T* mem)Caller should cast (*mem) to (const cl_mem). Caller is responsible for invoking clReleaseMemObject().
The device pointer has to be released by calling VecViennaCLRestoreCLMemWrite(). Upon restoring the vector data the data on the host will be marked as out of date. A subsequent access of the host data will thus incur a data transfer from the device to the host.
v | - the vector |
mem | - pointer to the device buffer |