Skip to main content
`Ctrl`+`K`

# PetscDeviceContextSynchronize

Block the host until all work queued on a `PetscDeviceContext` has finished

## Synopsis

    #include <petscdevice.h>
    PetscErrorCode PetscDeviceContextSynchronize(PetscDeviceContext dctx)

Not Collective

## Input Parameter

- dctx - The `PetscDeviceContext` to synchronize

## Notes

The host will not return from this routine until `dctx` is idle. Any and all memory operations queued on or otherwise associated with (either explicitly or implicitly via dependencies) are guaranteed to have finished and be globally visible on return.

In effect, this routine serves as memory and execution barrier.

## DAG representation

      time ->

      -> dctx - |= CALL =| - dctx ->

## See Also

`PetscDeviceContextFork()`, `PetscDeviceContextJoin()`, `PetscDeviceContextQueryIdle()`

## Level

beginner

## Location

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

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