From: Georgi Gerganov Date: Thu, 18 Sep 2025 07:03:24 +0000 (+0300) Subject: metal : handle nil cv during pipeline creation (llama/16065) X-Git-Tag: v0.9.1~16 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ff15c6a0642cba0b0aaab749a2075352b3f650d1;p=pkg%2Fggml%2Fsources%2Fggml metal : handle nil cv during pipeline creation (llama/16065) ggml-ci --- diff --git a/src/ggml-metal/ggml-metal-device.m b/src/ggml-metal/ggml-metal-device.m index 9983640b..4974bd15 100644 --- a/src/ggml-metal/ggml-metal-device.m +++ b/src/ggml-metal/ggml-metal-device.m @@ -327,12 +327,19 @@ ggml_metal_pipeline_t ggml_metal_library_compile_pipeline(ggml_metal_library_t l GGML_LOG_DEBUG("%s: compiling pipeline: base = '%s', name = '%s'\n", __func__, base, name); - id mtl_function = [lib->obj newFunctionWithName:base_func constantValues:(cv ? cv->obj : nil) error:&error]; + id mtl_function; + if (!cv) { + mtl_function = [lib->obj newFunctionWithName:base_func]; + } else { + mtl_function = [lib->obj newFunctionWithName:base_func constantValues:cv->obj error:&error]; + } if (!mtl_function) { ggml_critical_section_end(); GGML_LOG_ERROR("%s: error: failed to compile pipeline: base = '%s', name = '%s'\n", __func__, base, name); - GGML_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]); + if (error) { + GGML_LOG_ERROR("%s: error: %s\n", __func__, [[error description] UTF8String]); + } return nil; }