# PetscDeviceContextMarkIntentFromID
Indicate a `PetscDeviceContext`s access intent to the auto-dependency system 
## Synopsis
```
#include <petscdevice.h> 
PetscErrorCode PetscDeviceContextMarkIntentFromID(PetscDeviceContext dctx, PetscObjectId id, PetscMemoryAccessMode mode, const char name[])
```
Not Collective


## Input Parameters

- ***dctx -*** The `PetscDeviceContext`
- ***id   -*** The `PetscObjectId` to mark
- ***mode -*** The desired access intent
- ***name -*** The object name (for debug purposes, ignored in optimized builds)



## Notes
This routine formally informs the dependency system that `dctx` will access the object
represented by `id` with `mode` and adds `dctx` to `id`'s list of dependencies (termed
"leaves").

If the existing set of leaves have an incompatible `PetscMemoryAccessMode` to `mode`, `dctx`
will be serialized against them.




## See Also
 `PetscDeviceContextWaitForContext()`, `PetscDeviceContextSynchronize()`,
`PetscObjectGetId()`, `PetscMemoryAccessMode`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/device/interface/mark_dcontext.cxx.html#PetscDeviceContextMarkIntentFromID">src/sys/objects/device/interface/mark_dcontext.cxx</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/device/interface/mark_dcontext.cxx)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
