[Openmp-commits] [openmp] r362401 - Fixed build warning with -DLIBOMP_USE_HWLOC=1

Andrey Churbanov via Openmp-commits openmp-commits at lists.llvm.org
Mon Jun 3 07:21:59 PDT 2019


Author: achurbanov
Date: Mon Jun  3 07:21:59 2019
New Revision: 362401

URL: http://llvm.org/viewvc/llvm-project?rev=362401&view=rev
Log:
Fixed build warning with -DLIBOMP_USE_HWLOC=1

Made type of depth of hwloc object to correapond with
change from unsigned in hwloc 1,x to int in hwloc 2.x.
This eliminates the warning on signed-unsigned comparison.

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

Modified:
    openmp/trunk/runtime/src/kmp.h
    openmp/trunk/runtime/src/kmp_affinity.cpp

Modified: openmp/trunk/runtime/src/kmp.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp.h?rev=362401&r1=362400&r2=362401&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp.h (original)
+++ openmp/trunk/runtime/src/kmp.h Mon Jun  3 07:21:59 2019
@@ -96,6 +96,12 @@ class kmp_stats_list;
 #ifndef HWLOC_OBJ_PACKAGE
 #define HWLOC_OBJ_PACKAGE HWLOC_OBJ_SOCKET
 #endif
+#if HWLOC_API_VERSION >= 0x00020000
+// hwloc 2.0 changed type of depth of object from unsigned to int
+typedef int kmp_hwloc_depth_t;
+#else
+typedef unsigned int kmp_hwloc_depth_t;
+#endif
 #endif
 
 #if KMP_ARCH_X86 || KMP_ARCH_X86_64

Modified: openmp/trunk/runtime/src/kmp_affinity.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_affinity.cpp?rev=362401&r1=362400&r2=362401&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_affinity.cpp (original)
+++ openmp/trunk/runtime/src/kmp_affinity.cpp Mon Jun  3 07:21:59 2019
@@ -457,7 +457,8 @@ static int __kmp_hwloc_get_nobjs_under_o
 }
 
 static int __kmp_hwloc_count_children_by_depth(hwloc_topology_t t,
-                                               hwloc_obj_t o, unsigned depth,
+                                               hwloc_obj_t o,
+                                               kmp_hwloc_depth_t depth,
                                                hwloc_obj_t *f) {
   if (o->depth == depth) {
     if (*f == NULL)




More information about the Openmp-commits mailing list