[llvm] [llvm] Android has sched_getaffinity() now (PR #124689)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 27 19:46:32 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-support
Author: Brad Smith (brad0)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/124689.diff
1 Files Affected:
- (modified) llvm/lib/Support/Unix/Threading.inc (+1-1)
``````````diff
diff --git a/llvm/lib/Support/Unix/Threading.inc b/llvm/lib/Support/Unix/Threading.inc
index aedcd9aa34b99a..15a5b008604c32 100644
--- a/llvm/lib/Support/Unix/Threading.inc
+++ b/llvm/lib/Support/Unix/Threading.inc
@@ -387,7 +387,7 @@ static int computeHostNumPhysicalCores() {
static int computeHostNumPhysicalCores() {
return sysconf(_SC_NPROCESSORS_ONLN);
}
-#elif defined(__linux__) && !defined(__ANDROID__)
+#elif defined(__linux__)
static int computeHostNumPhysicalCores() {
cpu_set_t Affinity;
if (sched_getaffinity(0, sizeof(Affinity), &Affinity) == 0)
``````````
</details>
https://github.com/llvm/llvm-project/pull/124689
More information about the llvm-commits
mailing list