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,
Passes back device pointer of mapped pinned memory.
Passes back the device pointer
pdptrcorresponding to the mapped, pinned host bufferpallocated bycuMemHostAlloc.cuMemHostGetDevicePointer()will fail if theCU_MEMHOSTALLOC_DEVICEMAPflag 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 attributeCU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM, the memory can also be accessed from the device using the host pointerp. The device pointer returned bycuMemHostGetDevicePointer()may or may not match the original host pointerpand 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 bycuMemHostGetDevicePointer()will match the original pointerp. If any device visible to the application has a zero value for the device attribute, the device pointer returned bycuMemHostGetDevicePointer()will not match the original host pointerp, 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.flagsprovides 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