VecCreateSeqKokkosWithArray#

Creates a Kokkos sequential array-style vector, where the user provides the array space to store the vector values. The array provided must be a device array.

Synopsis#

Collective

Input Parameters#

  • comm - the communicator, should be PETSC_COMM_SELF

  • bs - the block size

  • n - the vector length

  • darray - device memory where the vector elements are to be stored.

Output Parameter#

  • v - the vector

Notes#

Use VecDuplicate() or VecDuplicateVecs() to form additional vectors of the same type as an existing vector.

If darray is NULL, the vector is created without any array, on host or device; VecKokkosPlaceArray() (with a device array) or VecPlaceArray() (with a host array) must then be called before the vector is used.

PETSc does NOT free the array when the vector is destroyed via VecDestroy(). The user should not free the array until the vector is destroyed.

See Also#

VecCreateMPICUDAWithArray(), VecCreate(), VecDuplicate(), VecDuplicateVecs(), VecCreateGhost(), VecCreateSeq(), VecCreateSeqWithArray(), VecCreateMPIWithArray(), VecKokkosPlaceArray(), VecPlaceArray()

Level#

intermediate

Location#

src/vec/vec/impls/seq/kokkos/veckok.kokkos.cxx

Examples#

src/vec/vec/tests/ex16k.kokkos.cxx
src/vec/vec/tests/ex60.c


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