[Openmp-commits] [openmp] r282947 - Insert missing checks for KMP_AFFINITY_CAPABLE() in affinity API.
Jonathan Peyton via Openmp-commits
openmp-commits at lists.llvm.org
Fri Sep 30 13:56:45 PDT 2016
Author: jlpeyton
Date: Fri Sep 30 15:56:44 2016
New Revision: 282947
URL: http://llvm.org/viewvc/llvm-project?rev=282947&view=rev
Log:
Insert missing checks for KMP_AFFINITY_CAPABLE() in affinity API.
If affinity is not capable, then these API functions will perform the stubs
version.
Modified:
openmp/trunk/runtime/src/kmp_ftn_entry.h
Modified: openmp/trunk/runtime/src/kmp_ftn_entry.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_ftn_entry.h?rev=282947&r1=282946&r2=282947&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_ftn_entry.h (original)
+++ openmp/trunk/runtime/src/kmp_ftn_entry.h Fri Sep 30 15:56:44 2016
@@ -690,6 +690,8 @@ FTN_GET_NUM_PLACES( void )
if ( ! TCR_4(__kmp_init_middle) ) {
__kmp_middle_initialize();
}
+ if (!KMP_AFFINITY_CAPABLE())
+ return 0;
return __kmp_affinity_num_masks;
#endif
}
@@ -705,6 +707,8 @@ FTN_GET_PLACE_NUM_PROCS( int place_num )
if ( ! TCR_4(__kmp_init_middle) ) {
__kmp_middle_initialize();
}
+ if (!KMP_AFFINITY_CAPABLE())
+ return 0;
if ( place_num < 0 || place_num >= (int)__kmp_affinity_num_masks )
return 0;
kmp_affin_mask_t *mask = KMP_CPU_INDEX(__kmp_affinity_masks, place_num);
@@ -729,6 +733,8 @@ FTN_GET_PLACE_PROC_IDS( int place_num, i
if ( ! TCR_4(__kmp_init_middle) ) {
__kmp_middle_initialize();
}
+ if (!KMP_AFFINITY_CAPABLE())
+ return;
if ( place_num < 0 || place_num >= (int)__kmp_affinity_num_masks )
return;
kmp_affin_mask_t *mask = KMP_CPU_INDEX(__kmp_affinity_masks, place_num);
@@ -754,6 +760,8 @@ FTN_GET_PLACE_NUM( void )
if ( ! TCR_4(__kmp_init_middle) ) {
__kmp_middle_initialize();
}
+ if (!KMP_AFFINITY_CAPABLE())
+ return -1;
gtid = __kmp_entry_gtid();
thread = __kmp_thread_from_gtid(gtid);
if ( thread->th.th_current_place < 0 )
@@ -773,6 +781,8 @@ FTN_GET_PARTITION_NUM_PLACES( void )
if ( ! TCR_4(__kmp_init_middle) ) {
__kmp_middle_initialize();
}
+ if (!KMP_AFFINITY_CAPABLE())
+ return 0;
gtid = __kmp_entry_gtid();
thread = __kmp_thread_from_gtid(gtid);
first_place = thread->th.th_first_place;
@@ -797,6 +807,8 @@ FTN_GET_PARTITION_PLACE_NUMS( int *place
if ( ! TCR_4(__kmp_init_middle) ) {
__kmp_middle_initialize();
}
+ if (!KMP_AFFINITY_CAPABLE())
+ return;
gtid = __kmp_entry_gtid();
thread = __kmp_thread_from_gtid(gtid);
first_place = thread->th.th_first_place;
More information about the Openmp-commits
mailing list