[Openmp-commits] [openmp] 55dff8b - [OpenMP] Update HWLOC code for die level detection

via Openmp-commits openmp-commits at lists.llvm.org
Mon Feb 22 11:06:24 PST 2021


Author: Peyton, Jonathan L
Date: 2021-02-22T13:05:55-06:00
New Revision: 55dff8b2e4f0ac9e852b5abc053af8dcf6c744f1

URL: https://github.com/llvm/llvm-project/commit/55dff8b2e4f0ac9e852b5abc053af8dcf6c744f1
DIFF: https://github.com/llvm/llvm-project/commit/55dff8b2e4f0ac9e852b5abc053af8dcf6c744f1.diff

LOG: [OpenMP] Update HWLOC code for die level detection

Differential Revision: https://reviews.llvm.org/D96748

Added: 
    

Modified: 
    openmp/runtime/src/kmp_affinity.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp
index 03f2e19339fd..e5e1d2142d70 100644
--- a/openmp/runtime/src/kmp_affinity.cpp
+++ b/openmp/runtime/src/kmp_affinity.cpp
@@ -19,6 +19,10 @@
 #if KMP_USE_HIER_SCHED
 #include "kmp_dispatch_hier.h"
 #endif
+#if KMP_USE_HWLOC
+// Copied from hwloc
+#define HWLOC_GROUP_KIND_INTEL_DIE 104
+#endif
 
 // Store the real or imagined machine hierarchy here
 static hierarchy_info machine_hierarchy;
@@ -583,6 +587,13 @@ static inline kmp_hw_t __kmp_hwloc_type_2_topology_type(hwloc_obj_t obj) {
     return KMP_HW_CORE;
   case HWLOC_OBJ_PU:
     return KMP_HW_THREAD;
+  case HWLOC_OBJ_GROUP:
+    if (obj->attr->group.kind == HWLOC_GROUP_KIND_INTEL_DIE)
+      return KMP_HW_DIE;
+#if HWLOC_API_VERSION >= 0x00020100
+  case HWLOC_OBJ_DIE:
+    return KMP_HW_DIE;
+#endif
   }
   return KMP_HW_UNKNOWN;
 }


        


More information about the Openmp-commits mailing list