Skip to content

Commit 97b9d5e

Browse files
ngxsonarthw
authored andcommitted
ggml : fix missing cpu_set_t on emscripten (ggml-org#9336)
* ggml : fix missing cpu_set_t on emscripten * better version * bring back android part
1 parent bcd80a3 commit 97b9d5e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

ggml/src/ggml.c

+14-1
Original file line numberDiff line numberDiff line change
@@ -19556,7 +19556,8 @@ static bool ggml_thread_apply_priority(int32_t prio) {
1955619556
return true;
1955719557
}
1955819558

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

1956119562
static bool ggml_thread_apply_affinity(const bool * mask) {
1956219563
cpu_set_t cpuset;
@@ -19611,6 +19612,18 @@ static bool ggml_thread_apply_priority(int32_t prio) {
1961119612
return true;
1961219613
}
1961319614

19615+
#else // unsupported platforms
19616+
19617+
static bool ggml_thread_apply_affinity(const bool * mask) {
19618+
UNUSED(mask);
19619+
return true;
19620+
}
19621+
19622+
static bool ggml_thread_apply_priority(int32_t prio) {
19623+
UNUSED(prio);
19624+
return true;
19625+
}
19626+
1961419627
#endif
1961519628

1961619629
static bool ggml_thread_cpumask_is_valid(const bool * mask) {

0 commit comments

Comments
 (0)