[llvm] [llvm] Android has sched_getaffinity() now (PR #124689)
Brad Smith via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 27 19:45:59 PST 2025
https://github.com/brad0 created https://github.com/llvm/llvm-project/pull/124689
None
>From a282c3beb54e611041183f34dbf4fcc321a5609f Mon Sep 17 00:00:00 2001
From: Brad Smith <brad at comstyle.com>
Date: Mon, 27 Jan 2025 22:43:21 -0500
Subject: [PATCH] [llvm] Android has sched_getaffinity() now
---
llvm/lib/Support/Unix/Threading.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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)
More information about the llvm-commits
mailing list