Skip to content

Commit 778181a

Browse files
ngxsonggerganov
authored andcommitted
ggml : fix missing cpu_set_t on emscripten (llama/9336)
* ggml : fix missing cpu_set_t on emscripten * better version * bring back android part
1 parent b211687 commit 778181a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/ggml.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19541,7 +19541,8 @@ static bool ggml_thread_apply_priority(int32_t prio) {
1954119541
return true;
1954219542
}
1954319543

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

1954619547
static bool ggml_thread_apply_affinity(const bool * mask) {
1954719548
cpu_set_t cpuset;
@@ -19596,6 +19597,18 @@ static bool ggml_thread_apply_priority(int32_t prio) {
1959619597
return true;
1959719598
}
1959819599

19600+
#else // unsupported platforms
19601+
19602+
static bool ggml_thread_apply_affinity(const bool * mask) {
19603+
UNUSED(mask);
19604+
return true;
19605+
}
19606+
19607+
static bool ggml_thread_apply_priority(int32_t prio) {
19608+
UNUSED(prio);
19609+
return true;
19610+
}
19611+
1959919612
#endif
1960019613

1960119614
static bool ggml_thread_cpumask_is_valid(const bool * mask) {

0 commit comments

Comments
 (0)