PetscDeviceContextSetCurrentContext#

Set the current active PetscDeviceContext

Synopsis#

Not Collective

Input Parameter#

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


Edit on GitLab

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