PetscDeviceContextGetDefaultContext#

Get the default-stream context for the current device

Synopsis#

Not Collective

Output Parameter#

  • dctx - The borrowed default-stream context

Notes#

The context uses PETSC_STREAM_DEFAULT on the device attached to the current context. It is created lazily and owned by PETSc. Do not destroy or reconfigure the borrowed context. Duplicate it to obtain an independently owned context.

The returned handle captures a particular context and remains valid until PetscFinalize(), even if the current device changes. In contrast, PetscDeviceContextDefault is resolved again at each accepting API call. In the C-only device-interface fallback, this routine returns a null handle.

See Also#

PetscDeviceContextDefault, PetscDeviceContextGetCurrentContext(), PetscDeviceContextDuplicate()

Level#

beginner

Location#

src/sys/objects/device/interface/dcontext.cxx

Examples#

src/sys/objects/device/tests/ex9.c


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