PetscDeviceContextDelay#

Queue a delay on a device context for testing stream ordering

Synopsis#

#include <petscdevice.h> 
PetscErrorCode PetscDeviceContextDelay(PetscDeviceContext dctx, PetscReal seconds)

Not Collective; Asynchronous

Input Parameters#

  • dctx - the device context

  • seconds - length of the delay in seconds, which must be finite and nonnegative

Notes#

This routine is intended for tests of asynchronous stream operations. On CUDA and HIP, it queues a host callback after earlier work on dctx without waiting for the callback to complete. Work queued later on the same context waits for the callback. Use PetscDeviceContextSynchronize() to wait for the delay to finish.

A host context sleeps before returning. SYCL contexts are not yet supported.

See Also#

PetscDeviceContextSynchronize(), PetscDeviceContextQueryIdle(), PetscDeviceContextGetStreamHandle()

Level#

developer

Location#

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

Examples#

src/sys/objects/device/tests/ex9.c
src/sys/objects/device/tests/ex13.cxx
src/sys/objects/device/tests/ex7.c
src/dm/tests/ex56.c
src/ksp/ksp/utils/lmvm/tests/ex4.c
src/ksp/pc/tests/ex17.c
src/mat/tests/ex254.c
src/mat/tests/ex324.c
src/vec/is/sf/tests/ex26.c
src/vec/vec/tests/ex65.c


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