PetscDeviceContextSetCurrentContext#
Set the current active PetscDeviceContext
Synopsis#
#include <petscdevice.h>
PetscErrorCode PetscDeviceContextSetCurrentContext(PetscDeviceContext dctx)
Not Collective
Input Parameter#
dctx - The
PetscDeviceContext
Notes#
This routine can be used to set the defacto “root” PetscDeviceContext to a user-defined
implementation by calling this routine immediately after PetscInitialize() and ensuring that
PetscDevice is not greedily initialized. In this case the user is responsible for destroying
their PetscDeviceContext before PetscFinalize() returns.
The old context is not stored in any way by this routine; if one is overriding a context that
they themselves do not control, one should take care to temporarily store it by calling
PetscDeviceContextGetCurrentContext() before calling this routine.
See Also#
PetscDeviceContextGetCurrentContext(), PetscDeviceContextFork(),
PetscDeviceContextJoin(), PetscDeviceContextCreate()
Level#
beginner
Location#
src/sys/objects/device/interface/global_dcontext.cxx
Index of all Device routines
Table of Contents for all manual pages
Index of all manual pages