:orphan: # PetscGetMemType Query the `PetscMemType` of a pointer ## Synopsis ``` #include PetscErrorCode PetscGetMemType(const void *ptr, PetscMemType *type) ``` Not Collective ## Input Parameter - ***ptr -*** The pointer to query (may be `NULL`) ## Output Parameter - ***type -*** The `PetscMemType` of the pointer ## Notes Currently only CUDA and HIP memtypes are supported. ## See Also so: `PetscMemType`, `PetscDeviceMalloc()`, `PetscDeviceCalloc()`, `PetscDeviceFree()`, `PetscDeviceArrayCopy()`, `PetscDeviceArrayZero()` ## Level intermediate ## Location src/sys/objects/device/util/memory.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/device/util/memory.c) [Index of all Sys routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)