Skip to main content

nuvec_gpu/
memory.rs

1//! Allocator statistics (shared by every target).
2
3/// Memory use and limits of a device's allocator, in bytes.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub struct MemoryStats {
6    /// Bytes in live buffers (rounded allocation sizes).
7    pub active: usize,
8    /// Highest `active` since creation or the last `Device::reset_peak`.
9    pub peak: usize,
10    /// Bytes held in the cache for reuse.
11    pub cache: usize,
12    /// Allocations that would push `active` past this fail.
13    pub memory_limit: usize,
14    /// The cache is trimmed to at most this many bytes.
15    pub cache_limit: usize,
16    /// Buffers obtained from Metal (cache misses) so far.
17    pub system_allocations: u64,
18    /// Buffers are kept resident up to this many bytes (see
19    /// `Device::set_wired_limit`).
20    pub wired_limit: usize,
21    /// Bytes currently wired.
22    pub wired: usize,
23}