CUDA Runtime API (PDF) - v10.0.130 (older) - Last updated August 25, 2018 - Send Feedback

## 6.23. cudaPointerAttributes Struct Reference

## [Data types used by CUDA Runtime]

CUDA pointer attributes

### Public Variables

int device
void * devicePointer
void * hostPointer
__CUDA_DEPRECATED int isManaged
__CUDA_DEPRECATED enumcudaMemoryType memoryType
enumcudaMemoryType type

### Variables

int cudaPointerAttributes::device [inherited]

  The device against which the memory was allocated or registered. If the memory type is cudaMemoryTypeDevice then this identifies the device on which the memory referred physically resides. If the memory type is cudaMemoryTypeHost or::cudaMemoryTypeManaged then this identifies the device which was current when the memory was allocated or registered (and if that device is deinitialized then this allocation will vanish with that device's state).

void * cudaPointerAttributes::devicePointer [inherited]

  The address which may be dereferenced on the current device to access the memory or NULL if no such address exists.

void * cudaPointerAttributes::hostPointer [inherited]

  The address which may be dereferenced on the host to access the memory or NULL if no such address exists.

  Note:

  CUDA doesn't check if unregistered memory is allocated so this field may contain invalid pointer if an invalid pointer has been passed to CUDA.

__CUDA_DEPRECATED int cudaPointerAttributes::isManaged [inherited]

  Indicates if this pointer points to managed memory

__CUDA_DEPRECATED enumcudaMemoryType cudaPointerAttributes::memoryType [inherited]

  The physical location of the memory, cudaMemoryTypeHost or cudaMemoryTypeDevice. Note that managed memory can return either cudaMemoryTypeDevice or cudaMemoryTypeHost regardless of it's physical location.

enumcudaMemoryType cudaPointerAttributes::type [inherited]

  The type of memory - cudaMemoryTypeUnregistered, cudaMemoryTypeHost, cudaMemoryTypeDevice or cudaMemoryTypeManaged.