iree/hal/allocator.h
static inline void iree_hal_allocator_statistics_record_alloc(
    iree_hal_allocator_statistics_t* statistics,
    iree_hal_memory_type_t memory_type, iree_device_size_t allocation_size) {
  if (iree_all_bits_set(memory_type, IREE_HAL_MEMORY_TYPE_HOST_LOCAL)) {
    statistics->host_bytes_allocated += allocation_size;
    statistics->host_bytes_peak =
        iree_max(statistics->host_bytes_peak, statistics->host_bytes_allocated -
                                                  statistics->host_bytes_freed);
  } else {
    statistics->device_bytes_allocated += allocation_size;
    statistics->device_bytes_peak = iree_max(
        statistics->device_bytes_peak,
        statistics->device_bytes_allocated - statistics->device_bytes_freed);
  }
}
// Records a buffer allocation to |statistics|.
Records a buffer allocation to |statistics|.
Records a buffer allocation to |statistics| .
static inline void iree_hal_allocator_statistics_record_alloc(
    iree_hal_allocator_statistics_t* statistics,
    iree_hal_memory_type_t memory_type, iree_device_size_t allocation_size) {
  if (iree_all_bits_set(memory_type, IREE_HAL_MEMORY_TYPE_HOST_LOCAL)) {
    statistics->host_bytes_allocated += allocation_size;
    statistics->host_bytes_peak =
        iree_max(statistics->host_bytes_peak, statistics->host_bytes_allocated -
                                                  statistics->host_bytes_freed);
  } else {
    statistics->device_bytes_allocated += allocation_size;
    statistics->device_bytes_peak = iree_max(
        statistics->device_bytes_peak,
        statistics->device_bytes_allocated - statistics->device_bytes_freed);
  }
}
static inline void iree_hal_allocator_statistics_record_alloc ( iree_hal_allocator_statistics_t * statistics , iree_hal_memory_type_t memory_type , iree_device_size_t allocation_size ) { if ( iree_all_bits_set ( memory_type , IREE_HAL_MEMORY_TYPE_HOST_LOCAL ) ) { statistics -> host_bytes_allocated += allocation_size ; statistics -> host_bytes_peak = iree_max ( statistics -> host_bytes_peak , statistics -> host_bytes_allocated - statistics -> host_bytes_freed ) ; } else { statistics -> device_bytes_allocated += allocation_size ; statistics -> device_bytes_peak = iree_max ( statistics -> device_bytes_peak , statistics -> device_bytes_allocated - statistics -> device_bytes_freed ) ; } }
Records a buffer allocation to |statistics|.
Records a buffer allocation to |statistics| .