summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/kmp_global.c
diff options
context:
space:
mode:
authorJonathan Peyton <jonathan.l.peyton@intel.com>2016-06-16 20:23:11 +0000
committerJonathan Peyton <jonathan.l.peyton@intel.com>2016-06-16 20:23:11 +0000
commit0f3c2b921d044cd1dc6747b8db5082e4f930b59c (patch)
tree5147aaaef94b8d68bf5311ef99555d6213c35fdd /openmp/runtime/src/kmp_global.c
parentc505ab6733997775b4aa9cd64cca455b79a7a371 (diff)
downloadbcm5719-llvm-0f3c2b921d044cd1dc6747b8db5082e4f930b59c.tar.gz
bcm5719-llvm-0f3c2b921d044cd1dc6747b8db5082e4f930b59c.zip
Teach OpenMP Library to use Hwloc on Windows
This patch allows a user to enable Hwloc on windows. There are three main changes in here: 1.kmp.h - Move definitions/declarations out of KMP_OS_WINDOWS guard (our windows implementation of affinity) because they need to be defined when KMP_USE_HWLOC is on as well. 2.teach __kmp_set_system_affinity, __kmp_get_system_affinity, __kmp_get_proc_group, and __kmp_affinity_bind_thread how to use hwloc. 3.teach CMake how to include hwloc when building Windows Another minor change in here is to make sure that anything under KMP_USE_HWLOC is also guarded by KMP_AFFINITY_SUPPORTED as well. This is to prevent Mac builds from requiring anything from Hwloc. Differential Revision: http://reviews.llvm.org/D21441 llvm-svn: 272951
Diffstat (limited to 'openmp/runtime/src/kmp_global.c')
-rw-r--r--openmp/runtime/src/kmp_global.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/openmp/runtime/src/kmp_global.c b/openmp/runtime/src/kmp_global.c
index 63e9dc38c84..2cf0e2fa5e0 100644
--- a/openmp/runtime/src/kmp_global.c
+++ b/openmp/runtime/src/kmp_global.c
@@ -35,10 +35,6 @@ __thread kmp_stats_list* __kmp_stats_thread_ptr = &__kmp_stats_list;
// gives reference tick for all events (considered the 0 tick)
tsc_tick_count __kmp_stats_start_time;
#endif
-#if KMP_USE_HWLOC
-int __kmp_hwloc_error = FALSE;
-hwloc_topology_t __kmp_hwloc_topology = NULL;
-#endif
/* ----------------------------------------------------- */
/* INITIALIZATION VARIABLES */
@@ -220,6 +216,11 @@ enum mic_type __kmp_mic_type = non_mic;
#if KMP_AFFINITY_SUPPORTED
+# if KMP_USE_HWLOC
+int __kmp_hwloc_error = FALSE;
+hwloc_topology_t __kmp_hwloc_topology = NULL;
+# endif
+
# if KMP_GROUP_AFFINITY
int __kmp_num_proc_groups = 1;
OpenPOWER on IntegriCloud