diff options
author | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2019-06-03 14:21:59 +0000 |
---|---|---|
committer | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2019-06-03 14:21:59 +0000 |
commit | 6973da5c32719dead93113061a40fccbc7e8f662 (patch) | |
tree | 117cabf62e7f795efd1e882d4548de9e396483ac /runtime | |
parent | 74db2a4213dd1f4d7b0056ebecbce6cfca3d3e30 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@362401 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/src/kmp.h | 6 | ||||
-rw-r--r-- | runtime/src/kmp_affinity.cpp | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/runtime/src/kmp.h b/runtime/src/kmp.h index 16ecaa5..0133108 100644 --- a/runtime/src/kmp.h +++ b/runtime/src/kmp.h @@ -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 diff --git a/runtime/src/kmp_affinity.cpp b/runtime/src/kmp_affinity.cpp index b8d585c..d86de7e 100644 --- a/runtime/src/kmp_affinity.cpp +++ b/runtime/src/kmp_affinity.cpp @@ -457,7 +457,8 @@ static int __kmp_hwloc_get_nobjs_under_obj(hwloc_obj_t obj, } 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) |