Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ggml : fix missing cpu_set_t on emscripten #9336

Merged
merged 3 commits into from
Sep 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
better version
  • Loading branch information
ngxson committed Sep 6, 2024
commit c4a1276ba73697aff02f7cd3d958d5c8f302714b
9 changes: 1 addition & 8 deletions ggml/src/ggml.c
Original file line number Diff line number Diff line change
@@ -19556,7 +19556,7 @@ static bool ggml_thread_apply_priority(int32_t prio) {
return true;
}

#elif ((defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) && !defined(__EMSCRIPTEN__))
#elif (defined(__gnu_linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__))
// TODO: this may not work on BSD, to be verified

static bool ggml_thread_apply_affinity(const bool * mask) {
@@ -19572,14 +19572,7 @@ static bool ggml_thread_apply_affinity(const bool * mask) {
}
}

#ifdef __ANDROID__
err = sched_setaffinity(0, sizeof(cpuset), &cpuset);
if (err < 0) {
err = errno;
}
#else
err = pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset);
#endif
if (err != 0) {
fprintf(stderr, "warn: failed to set affinity mask 0x%llx : %s (%d)\n", (unsigned long long)mask, strerror(err), err);
return false;