Function rcudnn_sys::cudaHostGetDevicePointer[][src]

pub unsafe extern "C" fn cudaHostGetDevicePointer(
    pDevice: *mut *mut c_void,
    pHost: *mut c_void,
    flags: c_uint
) -> cudaError_t
Expand description

\brief Passes back device pointer of mapped host memory allocated by cudaHostAlloc or registered by cudaHostRegister

Passes back the device pointer corresponding to the mapped, pinned host buffer allocated by ::cudaHostAlloc() or registered by ::cudaHostRegister().

::cudaHostGetDevicePointer() will fail if the ::cudaDeviceMapHost flag was not specified before deferred context creation occurred, or if called on a device that does not support mapped, pinned memory.

For devices that have a non-zero value for the device attribute ::cudaDevAttrCanUseHostPointerForRegisteredMem, the memory can also be accessed from the device using the host pointer \p pHost. The device pointer returned by ::cudaHostGetDevicePointer() may or may not match the original host pointer \p pHost 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 ::cudaHostGetDevicePointer() will match the original pointer \p pHost. If any device visible to the application has a zero value for the device attribute, the device pointer returned by ::cudaHostGetDevicePointer() will not match the original host pointer \p pHost, 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 of the two pointers and not both.

\p flags provides for future releases. For now, it must be set to 0.

\param pDevice - Returned device pointer for mapped memory \param pHost - Requested host pointer mapping \param flags - Flags for extensions (must be 0 for now)

\return ::cudaSuccess, ::cudaErrorInvalidValue, ::cudaErrorMemoryAllocation \notefnerr \note_init_rt \note_callback

\sa ::cudaSetDeviceFlags, ::cudaHostAlloc, ::cuMemHostGetDevicePointer