Page MenuHomePhabricator

[OpenMP][host runtime] Add initial hybrid CPU support
ClosedPublic

Authored by jlpeyton on Sep 24 2021, 11:08 AM.

Details

Summary

Detect, through CPUID.1A, and show user different core types through KMP_AFFINITY=verbose mechanism. Offer future runtime optimizations __kmp_is_hybrid_cpu() to know whether running on a hybrid system or not.

Diff Detail

Event Timeline

jlpeyton created this revision.Sep 24 2021, 11:08 AM
jlpeyton requested review of this revision.Sep 24 2021, 11:08 AM
Herald added a project: Restricted Project. · View Herald Transcript
Nawrin accepted this revision.Oct 4 2021, 9:55 AM

LGTM

This revision is now accepted and ready to land.Oct 4 2021, 9:55 AM
jdoerfert added inline comments.Oct 4 2021, 10:03 AM
openmp/runtime/src/kmp_affinity.h
601–607

Move this into the enum directly (as an enum value). Much easier to realize they belong together.

609–611
613
openmp/runtime/src/kmp_utility.cpp
249–250

This looks unrelated to "hybrid CPU" changes, no?

jlpeyton updated this revision to Diff 378227.Oct 8 2021, 8:23 AM

Addressed patch comments

Moved small fixup of RTM CPUID bit check into small commit that prefixes this one:

diff --git a/openmp/runtime/src/kmp_utility.cpp b/openmp/runtime/src/kmp_utility.cpp
index bf3e6114e0c2..8118548c162c 100644
--- a/openmp/runtime/src/kmp_utility.cpp
+++ b/openmp/runtime/src/kmp_utility.cpp
@@ -247,15 +247,15 @@ void __kmp_query_cpuid(kmp_cpuinfo_t *p) {
                 i, buf.eax, buf.ebx, buf.ecx, buf.edx));
     }
 #endif
-#if KMP_USE_ADAPTIVE_LOCKS
     p->flags.rtm = 0;
     if (max_arg > 7) {
       /* RTM bit CPUID.07:EBX, bit 11 */
       __kmp_x86_cpuid(7, 0, &buf);
       p->flags.rtm = (buf.ebx >> 11) & 1;
-      KA_TRACE(trace_level, (" RTM"));
+      if (p->flags.rtm) {
+        KA_TRACE(trace_level, (" RTM"));
+      }
     }
-#endif
   }

   { // Parse CPU brand string for frequency, saving the string for later.

@jdoerfert , does it look OK now?

This revision was landed with ongoing or failed builds.Oct 14 2021, 2:50 PM
This revision was automatically updated to reflect the committed changes.