File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -473,16 +473,19 @@ static void ggml_backend_metal_device_rel(struct ggml_backend_metal_device_conte
473473//
474474
475475struct ggml_metal_heap {
476- int n_unused; // number of times the heap was unused
476+ // number of times the heap was unused
477+ int n_unused;
477478
478- int64_t n_alloc; // total number of buffer allocations in this heap across all computes
479+ // total number of buffer allocations in this heap across all computes
480+ int64_t n_alloc;
479481
480482 // current offset in the heap - we reset this after each node in order to reuse the memory
481483 size_t offs;
482484
485+ // the currently allocated MTLBuffer objects in this heap
483486 id <MTLHeap > obj;
484487
485- NSMutableArray * bufs; // the currently allocated MTLBuffer objects in this heap
488+ NSMutableArray * bufs;
486489};
487490
488491static struct ggml_metal_heap * ggml_metal_heap_init (id <MTLDevice > device, size_t size) {
@@ -586,7 +589,7 @@ static void ggml_metal_mem_pool_free(struct ggml_metal_mem_pool * mem_pool) {
586589 size_t size_cur = 0 ;
587590
588591 for (ggml_metal_heap_ptr * ptr in mem_pool->heaps ) {
589- GGML_LOG_DEBUG (" %s : heap: %p \n " , __func__, (void *) ptr.data );
592+ GGML_LOG_DEBUG (" %s : heap: %p \n " , __func__, (void *) ptr.data );
590593 GGML_LOG_DEBUG (" %s : n_alloc: %" PRId64 " \n " , __func__, ptr.data ->n_alloc );
591594 GGML_LOG_DEBUG (" %s : n_unused: %d \n " , __func__, ptr.data ->n_unused );
592595 GGML_LOG_DEBUG (" %s : size: %.2f MiB\n " , __func__, [ptr.data->obj size ] / 1024.0 / 1024.0 );
You can’t perform that action at this time.
0 commit comments