PetscGetMemType#

Query the PetscMemType of a pointer

Synopsis#

#include <petscdevice.h> 
PetscErrorCode PetscGetMemType(const void *ptr, PetscMemType *type)

Not Collective, No Fortran Support

Input Parameter#

  • ptr - The pointer to query (may be NULL)

Output Parameter#

Notes#

Currently only CUDA and HIP memtypes are supported.

The CUDA and HIP calls needed to determine the PetscMemType take a non-trivial amount of time, thus for optimal GPU performance this routine should be used sparingly and instead the code should track the PetscMemType for its important arrays.

See Also#

PetscMemType, PetscDeviceMalloc(), PetscDeviceCalloc(), PetscDeviceFree(), PetscDeviceArrayCopy(), PetscDeviceArrayZero()

Level#

intermediate

Location#

src/sys/objects/device/util/memory.c


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