cuda.bindings._v2.driver.mem_host_get_device_pointer_v2#

cuda.bindings._v2.driver.mem_host_get_device_pointer_v2(
intptr_t p,
unsigned int flags,
) → uint64_t#

Passes back device pointer of mapped pinned memory.

Passes back the device pointer pdptr corresponding to the mapped, pinned host buffer p allocated by cuMemHostAlloc. cuMemHostGetDevicePointer() will fail if the CU_MEMHOSTALLOC_DEVICEMAP flag was not specified at the time the memory was allocated, or if the function is called on a GPU that does not support mapped pinned memory. For devices that have a non-zero value for the device attribute CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM, the memory can also be accessed from the device using the host pointer p. The device pointer returned by cuMemHostGetDevicePointer() may or may not match the original host pointer p and depends on the devices visible to the application. If all devices visible to the application have a non-zero value for the device attribute, the device pointer returned by cuMemHostGetDevicePointer() will match the original pointer p. If any device visible to the application has a zero value for the device attribute, the device pointer returned by cuMemHostGetDevicePointer() will not match the original host pointer p, but it will be suitable for use on all devices provided Unified Virtual Addressing is enabled. In such systems, it is valid to access the memory using either pointer on devices that have a non-zero value for the device attribute. Note however that such devices should access the memory using only one of the two pointers and not both. flags provides for future releases. For now, it must be set to 0.

Parameters:
  • p (intptr_t) – Host pointer.

  • flags (unsigned int) – Options (must be 0).

Returns:

Returned device pointer.

Return type:

uint64_t

See also

cuMemHostGetDevicePointer_v2