Skip to main content
`Ctrl`+`K`

# 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;

## Values

- `PETSC_DEVICE_COPY_HTOH` - Copy from host memory to host memory

- `PETSC_DEVICE_COPY_DTOH` - Copy from device memory to host memory

- `PETSC_DEVICE_COPY_HTOD` - Copy from host memory to device memory

- `PETSC_DEVICE_COPY_DTOD` - Copy from device memory to device memory

- `PETSC_DEVICE_COPY_AUTO` - Infer the copy direction from the pointers

## See Also

`PetscDeviceArrayCopy()`, `PetscDeviceMemcpy()`

## Level

beginner

## Location

include/petscdevicetypes.h

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