aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/kmp_affinity.h
diff options
context:
space:
mode:
authorJonathan Peyton <jonathan.l.peyton@intel.com>2018-08-09 22:04:30 +0000
committerJonathan Peyton <jonathan.l.peyton@intel.com>2018-08-09 22:04:30 +0000
commit2b9968a2f9b9ef9887769168407b4687e861e3b6 (patch)
tree177d33520d8e99a8a7f07b970bf13b56f9684ee1 /runtime/src/kmp_affinity.h
parentd97a5dfc16407bf9b934445dc5f1a223e3208436 (diff)
[OpenMP] Cleanup code
This patch cleans up unused functions, variables, sign compare issues, and addresses some -Warning flags which are now enabled including -Wcast-qual. Not all the warning flags in LibompHandleFlags.cmake are enabled, but some are with this patch. Some __kmp_gtid_from_* macros in kmp.h are switched to static inline functions which allows us to remove the awkward definition of KMP_DEBUG_ASSERT() and KMP_ASSERT() macros which used the comma operator. This had to be done for the innumerable -Wunused-value warnings related to KMP_DEBUG_ASSERT() Differential Revision: https://reviews.llvm.org/D49105 git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@339393 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/src/kmp_affinity.h')
-rw-r--r--runtime/src/kmp_affinity.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/runtime/src/kmp_affinity.h b/runtime/src/kmp_affinity.h
index e890165..6ff920e 100644
--- a/runtime/src/kmp_affinity.h
+++ b/runtime/src/kmp_affinity.h
@@ -81,13 +81,12 @@ public:
return error;
}
int get_proc_group() const override {
- int i;
int group = -1;
#if KMP_OS_WINDOWS
if (__kmp_num_proc_groups == 1) {
return 1;
}
- for (i = 0; i < __kmp_num_proc_groups; i++) {
+ for (int i = 0; i < __kmp_num_proc_groups; i++) {
// On windows, the long type is always 32 bits
unsigned long first_32_bits = hwloc_bitmap_to_ith_ulong(mask, i * 2);
unsigned long second_32_bits =
@@ -333,7 +332,7 @@ class KMPNativeAffinity : public KMPAffinity {
void deallocate_mask(KMPAffinity::Mask *m) override {
KMPNativeAffinity::Mask *native_mask =
static_cast<KMPNativeAffinity::Mask *>(m);
- delete m;
+ delete native_mask;
}
KMPAffinity::Mask *allocate_mask_array(int num) override {
return new Mask[num];