warp.set_mempool_release_threshold#
- warp.set_mempool_release_threshold(device, threshold)[source]#
Set the CUDA memory pool release threshold on the device.
This is the amount of reserved memory to hold onto before trying to release memory back to the OS. When more than this amount of bytes is held by the memory pool, the allocator will try to release memory back to the OS on the next call to stream, event, or device synchronize.
Values between 0 and 1 are interpreted as fractions of available memory. For example, 0.5 means half of the device’s physical memory. Greater values are interpreted as an absolute number of bytes. For example, 1024**3 means one GiB of memory.
- Parameters:
- Raises:
ValueError – If
deviceis not a CUDA device.RuntimeError – If
deviceis a CUDA device, but does not support memory pools.RuntimeError – Failed to set the memory pool release threshold.
- Return type:
None