gpu_cleanup

Function gpu_cleanup 

Source
pub fn gpu_cleanup() -> bool
Expand 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");