summaryrefslogtreecommitdiff
path: root/openmp/runtime/src/kmp_affinity.h
diff options
context:
space:
mode:
authorPeter Arzt <peter@arzt-fd.de>2025-10-15 10:58:41 +0200
committerCullen Rhodes <cullen.rhodes@arm.com>2025-11-03 09:35:47 +0000
commit8e2cd28cd4ba46613a46467b0c91b1cabead26cd (patch)
tree3039d11e5e4f623651845aab1427d3d866b9706d /openmp/runtime/src/kmp_affinity.h
parentdf3145bf4239824619ad36ffaf523fdcceac88c5 (diff)
[OpenMP] Fix preprocessor mismatches between include and usages of hwloc (#158349)llvmorg-21.1.5
Fix https://github.com/llvm/llvm-project/issues/156679 There is a mismatch between the preprocessor guards around the include of `hwloc.h` and those protecting its usages, leading to build failures on Darwin: https://github.com/spack/spack-packages/pull/1212 This change introduces `KMP_HWLOC_ENABLED` that reflects whether hwloc is actually used. (cherry picked from commit cd24d108a2c19c23c4ac80b501fa7361963cca3d)
Diffstat (limited to 'openmp/runtime/src/kmp_affinity.h')
-rw-r--r--openmp/runtime/src/kmp_affinity.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/openmp/runtime/src/kmp_affinity.h b/openmp/runtime/src/kmp_affinity.h
index dc3191caae63..fa69585f7e2d 100644
--- a/openmp/runtime/src/kmp_affinity.h
+++ b/openmp/runtime/src/kmp_affinity.h
@@ -18,7 +18,7 @@
#include <limits>
#if KMP_AFFINITY_SUPPORTED
-#if KMP_USE_HWLOC
+#if KMP_HWLOC_ENABLED
class KMPHwlocAffinity : public KMPAffinity {
public:
class Mask : public KMPAffinity::Mask {
@@ -109,7 +109,7 @@ public:
}
return error;
}
-#endif
+#endif // KMP_OS_WINDOWS
int get_proc_group() const override {
int group = -1;
#if KMP_OS_WINDOWS
@@ -191,7 +191,7 @@ public:
}
api_type get_api_type() const override { return HWLOC; }
};
-#endif /* KMP_USE_HWLOC */
+#endif /* KMP_HWLOC_ENABLED */
#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_DRAGONFLY || \
KMP_OS_AIX