Skip to content

Commit 1487eb8

Browse files
ngxsonNexesenex
authored andcommitted
ggml : fix missing cpu_set_t on emscripten (#9336)
* ggml : fix missing cpu_set_t on emscripten * better version * bring back android part
1 parent 845fb94 commit 1487eb8

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

ggml/src/ggml.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22286,7 +22286,8 @@ static bool ggml_thread_apply_priority(int32_t prio) {
2228622286
return true;
2228722287
}
2228822288

22289-
#else // posix?
22289+
#elif defined(__gnu_linux__)
22290+
// TODO: this may not work on BSD, to be verified
2229022291

2229122292
static bool ggml_thread_apply_affinity(const bool * mask) {
2229222293
cpu_set_t cpuset;
@@ -22341,6 +22342,18 @@ static bool ggml_thread_apply_priority(int32_t prio) {
2234122342
return true;
2234222343
}
2234322344

22345+
#else // unsupported platforms
22346+
22347+
static bool ggml_thread_apply_affinity(const bool * mask) {
22348+
UNUSED(mask);
22349+
return true;
22350+
}
22351+
22352+
static bool ggml_thread_apply_priority(int32_t prio) {
22353+
UNUSED(prio);
22354+
return true;
22355+
}
22356+
2234422357
#endif
2234522358

2234622359
static bool ggml_thread_cpumask_is_valid(const bool * mask) {

0 commit comments

Comments
 (0)