# PetscDeviceCopyMode
Describes the copy direction of a device-aware memcpy 
## Synopsis
```
#include <petscdevicetypes.h> 
typedef enum {
  PETSC_DEVICE_COPY_HTOH,
  PETSC_DEVICE_COPY_DTOH,
  PETSC_DEVICE_COPY_HTOD,
  PETSC_DEVICE_COPY_DTOD,
  PETSC_DEVICE_COPY_AUTO,
} PetscDeviceCopyMode;
```
```none
PETSC_DEVICE_COPY_HTOH - Copy from host memory to host memory
```
```none
PETSC_DEVICE_COPY_DTOH - Copy from device memory to host memory
```
```none
PETSC_DEVICE_COPY_HTOD - Copy from host memory to device memory
```
```none
PETSC_DEVICE_COPY_DTOD - Copy from device memory to device memory
```
```none
PETSC_DEVICE_COPY_AUTO - Infer the copy direction from the pointers
```




## See Also
 `PetscDeviceArrayCopy()`, `PetscDeviceMemcpy()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscdevicetypes.h.html#PetscDeviceCopyMode">include/petscdevicetypes.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscdevicetypes.h)


[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)  
