/// Log info messages about memory usage
Log info messages about memory usage
Log info messages about memory usage
pub fn log_usage(&self, chunk_number: usize, linearity: Linearity) {
        if chunk_number == 0 {
            // New type of chunk, log details about the memory type
            let mut propstring: String = String::new();
            if self.memory_type.property_flags.contains(MemoryPropertyFlags::DEVICE_LOCAL) {
                propstring.push_str("Device ");
            }
            if self.memory_type.property_flags.contains(MemoryPropertyFlags::HOST_VISIBLE) {
                propstring.push_str("Host ");
            }
            if self.memory_type.property_flags.contains(MemoryPropertyFlags::HOST_COHERENT) {
                propstring.push_str("HCoherent ");
            }
            if self.memory_type.property_flags.contains(MemoryPropertyFlags::HOST_CACHED) {
                propstring.push_str("HCached ");
            }
            if self.memory_type.property_flags.contains(MemoryPropertyFlags::LAZILY_ALLOCATED) {
                propstring.push_str("Lazy ");
            }
            info!("type{} heap{}: {} ({})",
                  self.memory_type_index,
                  self.memory_type.heap_index,
                  propstring,
                  linearity);
        }
        info!("  Chunk {} ({})", chunk_number, CHUNK_SIZE.separated_string());
        for block in &self.blocks {
            info!("     size={:>12}      ({:2.0}%): {}",
                  block.size.separated_string(),
                  (block.size * 100) as f32 / CHUNK_SIZE as f32,
                  block.reason);
        }
        for block in &self.perm_blocks {
            info!("     size={:>12} Perm ({:2.0}%): {}",
                  block.size.separated_string(),
                  (block.size * 100) as f32 / CHUNK_SIZE as f32,
                  block.reason);
        }
    }
pub fn log_usage ( & self , chunk_number : usize , linearity : Linearity ) { if chunk_number == 0 { // New type of chunk, log details about the memory type let mut propstring : String = String :: new ( ) ; if self . memory_type . property_flags . contains ( MemoryPropertyFlags :: DEVICE_LOCAL ) { propstring . push_str ( " " ) ; } if self . memory_type . property_flags . contains ( MemoryPropertyFlags :: HOST_VISIBLE ) { propstring . push_str ( " " ) ; } if self . memory_type . property_flags . contains ( MemoryPropertyFlags :: HOST_COHERENT ) { propstring . push_str ( " " ) ; } if self . memory_type . property_flags . contains ( MemoryPropertyFlags :: HOST_CACHED ) { propstring . push_str ( " " ) ; } if self . memory_type . property_flags . contains ( MemoryPropertyFlags :: LAZILY_ALLOCATED ) { propstring . push_str ( " " ) ; } info ! ( " " self memory_type_index self memory_type heap_index propstring linearity ) ; } info ! ( " " chunk_number CHUNK_SIZE separated_string ( ) ) ; for block in & self . blocks { info ! ( " " block size separated_string ( ) ( block size 100 ) as f32 CHUNK_SIZE as f32 block reason ) ; } for block in & self . perm_blocks { info ! ( " " block size separated_string ( ) ( block size 100 ) as f32 CHUNK_SIZE as f32 block reason ) ; } }
Log info messages about memory usage
Log info messages about memory usage
&self
chunk_number
usize
linearity
Linearity