PetscDeviceContextDuplicate — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# PetscDeviceContextDuplicate

Duplicates a `PetscDeviceContext` object

## Synopsis

    #include <petscdevice.h>
    PetscErrorCode PetscDeviceContextDuplicate(PetscDeviceContext dctx, PetscDeviceContext *dctxdup)

Not Collective

## Input Parameter

- dctx - The `PetscDeviceContext` to duplicate

## Output Parameter

- dctxdup - The duplicated `PetscDeviceContext`

## Notes

This is a shorthand method for creating a `PetscDeviceContext` with the exact same settings as another. Note however that `dctxdup` does not share any of the underlying data with `dctx`, (including its current stream-state) they are completely separate objects.

There is no implied ordering between `dctx` or `dctxdup`.

## DAG representation

      time ->

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

## See Also

`PetscDeviceContextCreate()`, `PetscDeviceContextSetDevice()`, `PetscDeviceContextSetStreamType()`

## Level

beginner

## Location

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

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