Function rcudnn::cudaMemPoolTrimTo[][src]

pub unsafe extern "C" fn cudaMemPoolTrimTo(
    memPool: *mut CUmemPoolHandle_st,
    minBytesToKeep: usize
) -> cudaError
Expand description

\brief Tries to release memory back to the OS

Releases memory back to the OS until the pool contains fewer than minBytesToKeep reserved bytes, or there is no more memory that the allocator can safely release. The allocator cannot release OS allocations that back outstanding asynchronous allocations. The OS allocations may happen at different granularity from the user allocations.

\note: Allocations that have not been freed count as outstanding. \note: Allocations that have been asynchronously freed but whose completion has not been observed on the host (eg. by a synchronize) can count as outstanding.

\param[in] pool - The memory pool to trim \param[in] minBytesToKeep - If the pool has less than minBytesToKeep reserved, the TrimTo operation is a no-op. Otherwise the pool will be guaranteed to have at least minBytesToKeep bytes reserved after the operation. \returns ::cudaSuccess, ::cudaErrorInvalidValue \note_callback

\sa ::cuMemPoolTrimTo, ::cudaMallocAsync, ::cudaFreeAsync, ::cudaDeviceGetDefaultMemPool, ::cudaDeviceGetMemPool, ::cudaMemPoolCreate