PETSc version 3.16.5
Fix/Edit manual page

# PetscMemType

Memory type of a pointer

### Synopsis

    typedef enum {PETSC_MEMTYPE_HOST=0, PETSC_MEMTYPE_DEVICE=0x01, PETSC_MEMTYPE_CUDA=0x01, PETSC_MEMTYPE_NVSHMEM=0x11,PETSC_MEMTYPE_HIP=0x03} PetscMemType;

### Developer Note

Encoding of the bitmask in binary: xxxxyyyz z = 0: Host memory z = 1: Device memory yyy = 000: CUDA-related memory yyy = 001: HIP-related memory xxxxyyy1 = 0000,0001: CUDA memory xxxxyyy1 = 0001,0001: CUDA NVSHMEM memory xxxxyyy1 = 0000,0011: HIP memory

Other types of memory, e.g., CUDA managed memory, can be added when needed.

### See Also

VecGetArrayAndMemType(), PetscSFBcastWithMemTypeBegin(), PetscSFReduceWithMemTypeBegin()

### Level

beginner

### Location

include/petscdevicetypes.h
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages