[Openmp-commits] [PATCH] D115664: [OpenMP][libomp] Fix compile errors with new KMP_HW_SUBSET changes
Jonathan Peyton via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Mon Dec 13 12:19:22 PST 2021
jlpeyton created this revision.
jlpeyton added reviewers: AndreyChurbanov, tlwilmar, kaz7.
jlpeyton added a project: OpenMP.
Herald added subscribers: pengfei, guansong, yaxunl.
jlpeyton requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.
Add missing guards around x86-specific code.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D115664
Files:
openmp/runtime/src/kmp_affinity.cpp
openmp/runtime/src/kmp_settings.cpp
Index: openmp/runtime/src/kmp_settings.cpp
===================================================================
--- openmp/runtime/src/kmp_settings.cpp
+++ openmp/runtime/src/kmp_settings.cpp
@@ -4994,11 +4994,14 @@
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))
Index: openmp/runtime/src/kmp_affinity.cpp
===================================================================
--- openmp/runtime/src/kmp_affinity.cpp
+++ openmp/runtime/src/kmp_affinity.cpp
@@ -1104,10 +1104,12 @@
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;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115664.394006.patch
Type: text/x-patch
Size: 1394 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20211213/90acf296/attachment.bin>
More information about the Openmp-commits
mailing list