ggml : fix missing cpu_set_t on emscripten (llama/9336)

* ggml : fix missing cpu_set_t on emscripten

* better version

* bring back android part
This commit is contained in:
Xuan Son Nguyen 2024-09-07 12:01:34 +02:00 committed by Georgi Gerganov
parent 9e715e1b96
commit 195877fd72

View File

@ -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) {