From 9a812fd6ba8fec62fdb0435b82359c19a3aefb1b Mon Sep 17 00:00:00 2001 From: stduhpf Date: Sat, 28 Dec 2024 06:06:17 +0100 Subject: [PATCH] fix: fix metal build (#513) --- ggml_extend.hpp | 5 ----- stable-diffusion.cpp | 2 +- upscaler.cpp | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/ggml_extend.hpp b/ggml_extend.hpp index 5f1db915..4aea8585 100644 --- a/ggml_extend.hpp +++ b/ggml_extend.hpp @@ -1174,11 +1174,6 @@ struct GGMLRunner { ggml_backend_cpu_set_n_threads(backend, n_threads); } -#ifdef SD_USE_METAL - if (ggml_backend_is_metal(backend)) { - ggml_backend_metal_set_n_cb(backend, n_threads); - } -#endif ggml_backend_graph_compute(backend, gf); #ifdef GGML_PERF ggml_graph_print(gf); diff --git a/stable-diffusion.cpp b/stable-diffusion.cpp index df97744a..e776fb91 100644 --- a/stable-diffusion.cpp +++ b/stable-diffusion.cpp @@ -168,7 +168,7 @@ class StableDiffusionGGML { #endif #ifdef SD_USE_METAL LOG_DEBUG("Using Metal backend"); - ggml_backend_metal_log_set_callback(ggml_log_callback_default, nullptr); + ggml_log_set(ggml_log_callback_default, nullptr); backend = ggml_backend_metal_init(); #endif #ifdef SD_USE_VULKAN diff --git a/upscaler.cpp b/upscaler.cpp index 1cf34c1a..86e5e9b4 100644 --- a/upscaler.cpp +++ b/upscaler.cpp @@ -21,7 +21,7 @@ struct UpscalerGGML { #endif #ifdef SD_USE_METAL LOG_DEBUG("Using Metal backend"); - ggml_backend_metal_log_set_callback(ggml_log_callback_default, nullptr); + ggml_log_set(ggml_log_callback_default, nullptr); backend = ggml_backend_metal_init(); #endif #ifdef SD_USE_VULKAN