From: Xuan Son Nguyen Date: Sat, 7 Sep 2024 10:01:34 +0000 (+0200) Subject: ggml : fix missing `cpu_set_t` on emscripten (llama/9336) X-Git-Tag: upstream/0.0.1642~392 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=778181a09ec14f62b66577504278bb543c56eaf1;p=pkg%2Fggml%2Fsources%2Fggml ggml : fix missing `cpu_set_t` on emscripten (llama/9336) * ggml : fix missing cpu_set_t on emscripten * better version * bring back android part --- diff --git a/src/ggml.c b/src/ggml.c index 08a90ced..212be9fe 100644 --- a/src/ggml.c +++ b/src/ggml.c @@ -19541,7 +19541,8 @@ static bool ggml_thread_apply_priority(int32_t prio) { return true; } -#else // posix? +#elif defined(__gnu_linux__) +// TODO: this may not work on BSD, to be verified static bool ggml_thread_apply_affinity(const bool * mask) { cpu_set_t cpuset; @@ -19596,6 +19597,18 @@ static bool ggml_thread_apply_priority(int32_t prio) { return true; } +#else // unsupported platforms + +static bool ggml_thread_apply_affinity(const bool * mask) { + UNUSED(mask); + return true; +} + +static bool ggml_thread_apply_priority(int32_t prio) { + UNUSED(prio); + return true; +} + #endif static bool ggml_thread_cpumask_is_valid(const bool * mask) {