From 6f755ea071fd360402694eedab7fdfa8b18ccced Mon Sep 17 00:00:00 2001 From: Grant Hansen Date: Thu, 14 May 2026 07:54:09 -0600 Subject: [PATCH] fix: update cpu_get_num_math to common_cpu_get_num_math (llama.cpp rename) Upstream llama.cpp renamed cpu_get_num_math() to common_cpu_get_num_math() in common/common.h as part of the common_* namespace pass. The function signature is unchanged. This updates the three call sites in the addon to use the new name, resolving the compile errors when rebuilding against current llama.cpp. - llama/addon/AddonContext.cpp:400 - llama/addon/AddonContext.cpp:748 - llama/addon/addon.cpp:54 --- llama/addon/AddonContext.cpp | 4 ++-- llama/addon/addon.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/llama/addon/AddonContext.cpp b/llama/addon/AddonContext.cpp index 017c6967..4a7de9aa 100644 --- a/llama/addon/AddonContext.cpp +++ b/llama/addon/AddonContext.cpp @@ -397,7 +397,7 @@ AddonContext::AddonContext(const Napi::CallbackInfo& info) : Napi::ObjectWrap().Int32Value(); const auto resolvedThreads = threads == 0 - ? std::max((int32_t)std::thread::hardware_concurrency(), std::max(cpu_get_num_math(), 1)) + ? std::max((int32_t)std::thread::hardware_concurrency(), std::max(common_cpu_get_num_math(), 1)) : threads; if (llama_n_threads(ctx) != resolvedThreads) { diff --git a/llama/addon/addon.cpp b/llama/addon/addon.cpp index eb1f35bf..f8816ebe 100644 --- a/llama/addon/addon.cpp +++ b/llama/addon/addon.cpp @@ -51,7 +51,7 @@ Napi::Value addonGetSupportsMlock(const Napi::CallbackInfo& info) { } Napi::Value addonGetMathCores(const Napi::CallbackInfo& info) { - return Napi::Number::New(info.Env(), cpu_get_num_math()); + return Napi::Number::New(info.Env(), common_cpu_get_num_math()); } Napi::Value addonGetBlockSizeForGgmlType(const Napi::CallbackInfo& info) {