VecViennaCLGetCLMem — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# VecViennaCLGetCLMem

Provides access to the CL buffer inside a Vec.

## Synopsis

    #include "petscvec.h"
    PETSC_EXTERN PetscErrorCode VecViennaCLGetCLMem(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 VecViennaCLRestoreCLMem(). 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.

## Input Parameter

- v - the vector

## Output Parameter

- mem - pointer to the device buffer

## See Also

`VecViennaCLGetCLContext()`, `VecViennaCLRestoreCLMem()`

## Level

intermediate

## Location

src/vec/vec/impls/seq/seqviennacl/vecviennacl.cxx

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