|
20 | 20 | #define GGML_METAL_MAX_COMMAND_BUFFERS 8 |
21 | 21 |
|
22 | 22 | // create residency sets only on macOS >= 15.0 |
23 | | -#if TARGET_OS_OSX && __MAC_OS_X_VERSION_MAX_ALLOWED >= 150000 |
| 23 | +#if TARGET_OS_OSX && __MAC_OS_X_VERSION_MAX_ALLOWED >= 150000 || \ |
| 24 | + TARGET_OS_IOS && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000 || \ |
| 25 | + TARGET_OS_TV && __TV_OS_VERSION_MAX_ALLOWED >= 180000 || \ |
| 26 | + TARGET_OS_VISION && __VISION_OS_VERSION_MAX_ALLOWED >= 200000 |
24 | 27 | #define GGML_METAL_HAS_RESIDENCY_SETS 1 |
25 | 28 | #endif |
26 | 29 |
|
@@ -1071,7 +1074,7 @@ static bool ggml_backend_metal_buffer_rset_init( |
1071 | 1074 | } |
1072 | 1075 |
|
1073 | 1076 | #if defined(GGML_METAL_HAS_RESIDENCY_SETS) |
1074 | | - if (@available(macOS 15.0, *)) { |
| 1077 | + if (@available(macOS 15.0, iOS 18.0, tvOS 18.0, visionOS 2.0, *)) { |
1075 | 1078 | MTLResidencySetDescriptor * desc = [[MTLResidencySetDescriptor alloc] init]; |
1076 | 1079 | desc.label = @"ggml_backend_metal"; |
1077 | 1080 | desc.initialCapacity = ctx->n_buffers; |
@@ -1106,7 +1109,7 @@ static bool ggml_backend_metal_buffer_rset_init( |
1106 | 1109 | // rset free |
1107 | 1110 | static void ggml_backend_metal_buffer_rset_free(struct ggml_backend_metal_buffer_context * ctx) { |
1108 | 1111 | #if defined(GGML_METAL_HAS_RESIDENCY_SETS) |
1109 | | - if (@available(macOS 15.0, *)) { |
| 1112 | + if (@available(macOS 15.0, iOS 18.0, tvOS 18.0, visionOS 2.0, *)) { |
1110 | 1113 | if (ctx->rset) { |
1111 | 1114 | [ctx->rset endResidency]; |
1112 | 1115 | [ctx->rset removeAllAllocations]; |
|
0 commit comments