pub fn gpu_cleanup() -> boolExpand description
Clear GPU buffer pools to release memory
Call this between benchmark groups or when GPU memory needs to be reclaimed. This clears:
- Buffer pool (reusable GPU buffers)
- Staging pool (GPU→CPU transfer buffers)
The function syncs the GPU before clearing to ensure all pending operations complete before buffers are released.
Returns true if cleanup succeeded, false if GPU unavailable.
§Example
ⓘ
use volta::gpu_cleanup;
// After a batch of GPU operations
gpu_cleanup();
println!("GPU memory released");