[Openmp-commits] [openmp] 9769340 - [OpenMP][libomp] Fix compile errors with new KMP_HW_SUBSET changes
Sylvestre Ledru via Openmp-commits
openmp-commits at lists.llvm.org
Mon Dec 13 23:33:21 PST 2021
Author: Jonathan Peyton
Date: 2021-12-14T08:33:05+01:00
New Revision: 9769340905d0033727817a3b0e4aef0b3863c964
URL: https://github.com/llvm/llvm-project/commit/9769340905d0033727817a3b0e4aef0b3863c964
DIFF: https://github.com/llvm/llvm-project/commit/9769340905d0033727817a3b0e4aef0b3863c964.diff
LOG: [OpenMP][libomp] Fix compile errors with new KMP_HW_SUBSET changes
Add missing guards around x86-specific code.
Reviewed By: kaz7
Differential Revision: https://reviews.llvm.org/D115664
Added:
Modified:
openmp/runtime/src/kmp_affinity.cpp
openmp/runtime/src/kmp_settings.cpp
Removed:
################################################################################
diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp
index 639f5d4f638b0..d0c05490b6b12 100644
--- a/openmp/runtime/src/kmp_affinity.cpp
+++ b/openmp/runtime/src/kmp_affinity.cpp
@@ -1104,10 +1104,12 @@ bool kmp_topology_t::filter_hw_subset() {
struct core_type_indexer {
int operator()(const kmp_hw_thread_t &t) const {
switch (t.attrs.get_core_type()) {
+#if KMP_ARCH_X86 || KMP_ARCH_X86_64
case KMP_HW_CORE_TYPE_ATOM:
return 1;
case KMP_HW_CORE_TYPE_CORE:
return 2;
+#endif
case KMP_HW_CORE_TYPE_UNKNOWN:
return 0;
}
diff --git a/openmp/runtime/src/kmp_settings.cpp b/openmp/runtime/src/kmp_settings.cpp
index 858be501b0ae9..951406867ae50 100644
--- a/openmp/runtime/src/kmp_settings.cpp
+++ b/openmp/runtime/src/kmp_settings.cpp
@@ -4994,11 +4994,14 @@ static void __kmp_stg_parse_hw_subset(char const *name, char const *value,
if (attr_ptr) {
attr.clear();
// save the attribute
+#if KMP_ARCH_X86 || KMP_ARCH_X86_64
if (__kmp_str_match("intel_core", -1, attr_ptr + 1)) {
attr.set_core_type(KMP_HW_CORE_TYPE_CORE);
} else if (__kmp_str_match("intel_atom", -1, attr_ptr + 1)) {
attr.set_core_type(KMP_HW_CORE_TYPE_ATOM);
- } else if (__kmp_str_match("eff", 3, attr_ptr + 1)) {
+ }
+#endif
+ if (__kmp_str_match("eff", 3, attr_ptr + 1)) {
const char *number = attr_ptr + 1;
// skip the eff[iciency] token
while (isalpha(*number))
More information about the Openmp-commits
mailing list