|
39 | 39 |
|
40 | 40 | bool has_simdgroup_reduction; |
41 | 41 | bool has_simdgroup_mm; |
| 42 | + bool has_residency_sets; |
42 | 43 | bool has_bfloat; |
43 | 44 | bool use_bfloat; |
44 | 45 |
|
|
48 | 49 | /*.mtl_device_ref_count =*/ 0, |
49 | 50 | /*.has_simdgroup_reduction =*/ false, |
50 | 51 | /*.has_simdgroup_mm =*/ false, |
| 52 | + /*.has_residency_sets =*/ false, |
51 | 53 | /*.has_bfloat =*/ false, |
52 | 54 | /*.use_bfloat =*/ false, |
53 | 55 | /*.name =*/ "", |
|
65 | 67 |
|
66 | 68 | ctx->has_simdgroup_mm = [ctx->mtl_device supportsFamily:MTLGPUFamilyApple7]; |
67 | 69 |
|
| 70 | +#if TARGET_OS_OSX && __MAC_OS_X_VERSION_MAX_ALLOWED >= 150000 |
| 71 | + ctx->has_residency_sets = true; |
| 72 | +#endif |
| 73 | + |
68 | 74 | ctx->has_bfloat = [ctx->mtl_device supportsFamily:MTLGPUFamilyMetal3_GGML]; |
69 | 75 | ctx->has_bfloat |= [ctx->mtl_device supportsFamily:MTLGPUFamilyApple6]; |
70 | 76 |
|
@@ -654,6 +660,7 @@ @implementation GGMLMetalClass |
654 | 660 |
|
655 | 661 | GGML_LOG_INFO("%s: simdgroup reduction = %s\n", __func__, ctx_dev->has_simdgroup_reduction ? "true" : "false"); |
656 | 662 | GGML_LOG_INFO("%s: simdgroup matrix mul. = %s\n", __func__, ctx_dev->has_simdgroup_mm ? "true" : "false"); |
| 663 | + GGML_LOG_INFO("%s: has residency sets = %s\n", __func__, ctx_dev->has_residency_sets ? "true" : "false"); |
657 | 664 | GGML_LOG_INFO("%s: has bfloat = %s\n", __func__, ctx_dev->has_bfloat ? "true" : "false"); |
658 | 665 | GGML_LOG_INFO("%s: use bfloat = %s\n", __func__, ctx_dev->use_bfloat ? "true" : "false"); |
659 | 666 | GGML_LOG_INFO("%s: hasUnifiedMemory = %s\n", __func__, ctx_dev->mtl_device.hasUnifiedMemory ? "true" : "false"); |
@@ -1047,7 +1054,7 @@ static void ggml_metal_free(struct ggml_backend_metal_context * ctx) { |
1047 | 1054 |
|
1048 | 1055 | // rset init |
1049 | 1056 | static bool ggml_backend_metal_buffer_rset_init(struct ggml_backend_metal_buffer_context * ctx, id<MTLDevice> device) { |
1050 | | -#if TARGET_OS_OSX |
| 1057 | +#if TARGET_OS_OSX && __MAC_OS_X_VERSION_MAX_ALLOWED >= 150000 |
1051 | 1058 | // create residency sets only on macOS |
1052 | 1059 | if (@available(macOS 15.0, *)) { |
1053 | 1060 | MTLResidencySetDescriptor * desc; |
|
0 commit comments