pub unsafe extern "C" fn hipMemPoolTrimTo(
mem_pool: hipMemPool_t,
min_bytes_to_hold: usize,
) -> hipError_t
Expand description
@brief Releases freed memory back to the OS
Releases memory back to the OS until the pool contains fewer than @p min_bytes_to_keep 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] mem_pool The memory pool to trim allocations @param[in] min_bytes_to_hold If the pool has less than min_bytes_to_hold reserved, then the TrimTo operation is a no-op. Otherwise the memory pool will contain at least min_bytes_to_hold bytes reserved after the operation.
@returns #hipSuccess, #hipErrorInvalidValue
@see hipMallocFromPoolAsync, hipMallocAsync, hipFreeAsync, hipMemPoolGetAttribute, hipDeviceSetMemPool, hipMemPoolSetAttribute, hipMemPoolSetAccess, hipMemPoolGetAccess
@warning : This API is marked as beta, meaning, while this is feature complete, it is still open to changes and may have outstanding issues.
@note This API is implemented on Linux, under development on Windows.