Skip to content

Commit

Permalink
ggml : fix missing cpu_set_t on emscripten (ggerganov#9336)
Browse files Browse the repository at this point in the history
* ggml : fix missing cpu_set_t on emscripten

* better version

* bring back android part
ngxson authored and arthw committed Nov 15, 2024
1 parent 4b6b601 commit 81b0882
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ggml/src/ggml.c
Original file line number Diff line number Diff line change
@@ -19556,7 +19556,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;
@@ -19611,6 +19612,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) {

0 comments on commit 81b0882

Please sign in to comment.