examples : adapt to metal API

This commit is contained in:
Georgi Gerganov 2024-01-14 00:09:26 +02:00
parent 435847891c
commit d839dd0242
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

View File

@ -1070,7 +1070,7 @@ static ggml_backend_t whisper_backend_init(const whisper_context_params & params
#ifdef GGML_USE_METAL #ifdef GGML_USE_METAL
if (params.use_gpu) { if (params.use_gpu) {
WHISPER_LOG_INFO("%s: using Metal backend\n", __func__); WHISPER_LOG_INFO("%s: using Metal backend\n", __func__);
ggml_metal_log_set_callback(g_state.log_callback, g_state.log_callback_user_data); ggml_backend_metal_log_set_callback(g_state.log_callback, g_state.log_callback_user_data);
backend_gpu = ggml_backend_metal_init(); backend_gpu = ggml_backend_metal_init();
if (!backend_gpu) { if (!backend_gpu) {
WHISPER_LOG_ERROR("%s: ggml_backend_metal_init() failed\n", __func__); WHISPER_LOG_ERROR("%s: ggml_backend_metal_init() failed\n", __func__);