Function rcudnn_sys::cudaMallocHost[][src]

pub unsafe extern "C" fn cudaMallocHost(
    ptr: *mut *mut c_void,
    size: usize
) -> cudaError_t
Expand description

\brief Allocates page-locked memory on the host

Allocates \p size bytes of host memory that is page-locked and accessible to the device. The driver tracks the virtual memory ranges allocated with this function and automatically accelerates calls to functions such as ::cudaMemcpy*(). Since the memory can be accessed directly by the device, it can be read or written with much higher bandwidth than pageable memory obtained with functions such as ::malloc(). Allocating excessive amounts of memory with ::cudaMallocHost() may degrade system performance, since it reduces the amount of memory available to the system for paging. As a result, this function is best used sparingly to allocate staging areas for data exchange between host and device.

\param ptr - Pointer to allocated host memory \param size - Requested allocation size in bytes

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

\sa ::cudaMalloc, ::cudaMallocPitch, ::cudaMallocArray, ::cudaMalloc3D, ::cudaMalloc3DArray, ::cudaHostAlloc, ::cudaFree, ::cudaFreeArray, \ref ::cudaMallocHost(void**, size_t, unsigned int) “cudaMallocHost (C++ API)”, ::cudaFreeHost, ::cudaHostAlloc, ::cuMemAllocHost