@@ -346,9 +346,9 @@ static void ggml_metal_log(enum ggml_log_level level, const char * format, ...){
346
346
}
347
347
348
348
GGML_METAL_LOG_INFO (" %s : hasUnifiedMemory = %s \n " , __func__, ctx->device .hasUnifiedMemory ? " true" : " false" );
349
- GGML_METAL_LOG_INFO (" %s : recommendedMaxWorkingSetSize = %8.2f MB\n " , __func__, ctx->device .recommendedMaxWorkingSetSize / 1024.0 / 1024.0 );
349
+ GGML_METAL_LOG_INFO (" %s : recommendedMaxWorkingSetSize = %8.2f MB\n " , __func__, ctx->device .recommendedMaxWorkingSetSize / 1e6 );
350
350
if (ctx->device .maxTransferRate != 0 ) {
351
- GGML_METAL_LOG_INFO (" %s : maxTransferRate = %8.2f MB/s\n " , __func__, ctx->device .maxTransferRate / 1024.0 / 1024.0 );
351
+ GGML_METAL_LOG_INFO (" %s : maxTransferRate = %8.2f MB/s\n " , __func__, ctx->device .maxTransferRate / 1e6 );
352
352
} else {
353
353
GGML_METAL_LOG_INFO (" %s : maxTransferRate = built-in GPU\n " , __func__);
354
354
}
@@ -541,11 +541,11 @@ bool ggml_metal_add_buffer(
541
541
ctx->buffers [ctx->n_buffers].metal = [ctx->device newBufferWithBytesNoCopy: data length: size_aligned options: MTLResourceStorageModeShared deallocator: nil ];
542
542
543
543
if (ctx->buffers [ctx->n_buffers].metal == nil ) {
544
- GGML_METAL_LOG_ERROR (" %s : error: failed to allocate '%-16s ' buffer, size = %8.2f MB\n " , __func__, name, size_aligned / 1024.0 / 1024.0 );
544
+ GGML_METAL_LOG_ERROR (" %s : error: failed to allocate '%-16s ' buffer, size = %8.2f MB\n " , __func__, name, size_aligned / 1e6 );
545
545
return false ;
546
546
}
547
547
548
- GGML_METAL_LOG_INFO (" %s : allocated '%-16s ' buffer, size = %8.2f MB" , __func__, name, size_aligned / 1024.0 / 1024.0 );
548
+ GGML_METAL_LOG_INFO (" %s : allocated '%-16s ' buffer, size = %8.2f MB" , __func__, name, size_aligned / 1e6 );
549
549
550
550
++ctx->n_buffers ;
551
551
} else {
@@ -565,11 +565,11 @@ bool ggml_metal_add_buffer(
565
565
ctx->buffers [ctx->n_buffers].metal = [ctx->device newBufferWithBytesNoCopy: (void *) ((uint8_t *) data + i) length: size_step_aligned options: MTLResourceStorageModeShared deallocator: nil ];
566
566
567
567
if (ctx->buffers [ctx->n_buffers].metal == nil ) {
568
- GGML_METAL_LOG_ERROR (" %s : error: failed to allocate '%-16s ' buffer, size = %8.2f MB\n " , __func__, name, size_step_aligned / 1024.0 / 1024.0 );
568
+ GGML_METAL_LOG_ERROR (" %s : error: failed to allocate '%-16s ' buffer, size = %8.2f MB\n " , __func__, name, size_step_aligned / 1e6 );
569
569
return false ;
570
570
}
571
571
572
- GGML_METAL_LOG_INFO (" %s : allocated '%-16s ' buffer, size = %8.2f MB, offs = %12ld " , __func__, name, size_step_aligned / 1024.0 / 1024.0 , i);
572
+ GGML_METAL_LOG_INFO (" %s : allocated '%-16s ' buffer, size = %8.2f MB, offs = %12ld " , __func__, name, size_step_aligned / 1e6 , i);
573
573
if (i + size_step < size) {
574
574
GGML_METAL_LOG_INFO (" \n " );
575
575
}
@@ -580,16 +580,16 @@ bool ggml_metal_add_buffer(
580
580
581
581
#if TARGET_OS_OSX
582
582
GGML_METAL_LOG_INFO (" , (%8.2f / %8.2f )" ,
583
- ctx->device .currentAllocatedSize / 1024.0 / 1024.0 ,
584
- ctx->device .recommendedMaxWorkingSetSize / 1024.0 / 1024.0 );
583
+ ctx->device .currentAllocatedSize / 1e6 ,
584
+ ctx->device .recommendedMaxWorkingSetSize / 1e6 );
585
585
586
586
if (ctx->device .currentAllocatedSize > ctx->device .recommendedMaxWorkingSetSize ) {
587
587
GGML_METAL_LOG_WARN (" %s : warning: current allocated size is greater than the recommended max working set size\n " , __func__);
588
588
} else {
589
589
GGML_METAL_LOG_INFO (" \n " );
590
590
}
591
591
#else
592
- GGML_METAL_LOG_INFO (" , (%8.2f )\n " , ctx->device .currentAllocatedSize / 1024.0 / 1024.0 );
592
+ GGML_METAL_LOG_INFO (" , (%8.2f )\n " , ctx->device .currentAllocatedSize / 1e6 );
593
593
#endif
594
594
}
595
595
0 commit comments