Skip to content

Commit 6d10cf7

Browse files
committed
Check for Xcode version before using recommendedMaxWorkingSetSize
1 parent 3c4d2a1 commit 6d10cf7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ggml-metal.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,11 @@ static void ggml_metal_log(enum ggml_log_level level, const char * format, ...){
370370
GGML_METAL_LOG_INFO("%s: simdgroup matrix mul. support = %s\n", __func__, ctx->support_simdgroup_mm ? "true" : "false");
371371
GGML_METAL_LOG_INFO("%s: hasUnifiedMemory = %s\n", __func__, ctx->device.hasUnifiedMemory ? "true" : "false");
372372

373+
#if TARGET_OS_OSX || (TARGET_OS_IOS && __clang_major__ >= 15)
373374
if (@available(macOS 10.12, iOS 16.0, *)) {
374375
GGML_METAL_LOG_INFO("%s: recommendedMaxWorkingSetSize = %8.2f MB\n", __func__, ctx->device.recommendedMaxWorkingSetSize / 1e6);
375376
}
376-
#if TARGET_OS_OSX
377+
#elseif TARGET_OS_OSX
377378
if (ctx->device.maxTransferRate != 0) {
378379
GGML_METAL_LOG_INFO("%s: maxTransferRate = %8.2f MB/s\n", __func__, ctx->device.maxTransferRate / 1e6);
379380
} else {
@@ -2373,7 +2374,7 @@ static void ggml_backend_metal_buffer_clear(ggml_backend_buffer_t buffer, uint8_
23732374
}
23742375

23752376
static void ggml_backend_metal_log_allocated_size(id<MTLDevice> device) {
2376-
#if TARGET_OS_IOS || TARGET_OS_OSX
2377+
#if TARGET_OS_OSX || (TARGET_OS_IOS && __clang_major__ >= 15)
23772378
if (@available(macOS 10.12, iOS 16.0, *)) {
23782379
GGML_METAL_LOG_INFO(", (%8.2f / %8.2f)",
23792380
device.currentAllocatedSize / 1024.0 / 1024.0,

0 commit comments

Comments
 (0)