[Openmp-commits] [openmp] r280538 - Decouple the kmp_affin_mask_t type from determining if affinity is capable

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Fri Sep 2 13:35:47 PDT 2016


Author: jlpeyton
Date: Fri Sep  2 15:35:47 2016
New Revision: 280538

URL: http://llvm.org/viewvc/llvm-project?rev=280538&view=rev
Log:
Decouple the kmp_affin_mask_t type from determining if affinity is capable

the __kmp_affinity_determine_capable() functions are highly operating system
specific.  This change has the functions use the type they expect explicitly.

Modified:
    openmp/trunk/runtime/src/z_Linux_util.c
    openmp/trunk/runtime/src/z_Windows_NT_util.c

Modified: openmp/trunk/runtime/src/z_Linux_util.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/z_Linux_util.c?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- openmp/trunk/runtime/src/z_Linux_util.c (original)
+++ openmp/trunk/runtime/src/z_Linux_util.c Fri Sep  2 15:35:47 2016
@@ -251,8 +251,8 @@ __kmp_affinity_determine_capable(const c
 
     int gCode;
     int sCode;
-    kmp_affin_mask_t *buf;
-    buf = ( kmp_affin_mask_t * ) KMP_INTERNAL_MALLOC( KMP_CPU_SET_SIZE_LIMIT );
+    unsigned char *buf;
+    buf = ( unsigned char * ) KMP_INTERNAL_MALLOC( KMP_CPU_SET_SIZE_LIMIT );
 
     // If Linux* OS:
     // If the syscall fails or returns a suggestion for the size,

Modified: openmp/trunk/runtime/src/z_Windows_NT_util.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/z_Windows_NT_util.c?rev=280538&r1=280537&r2=280538&view=diff
==============================================================================
--- openmp/trunk/runtime/src/z_Windows_NT_util.c (original)
+++ openmp/trunk/runtime/src/z_Windows_NT_util.c Fri Sep  2 15:35:47 2016
@@ -807,9 +807,9 @@ __kmp_affinity_determine_capable( const
     //
 
 #if KMP_GROUP_AFFINITY
-    KMP_AFFINITY_ENABLE(__kmp_num_proc_groups*sizeof(kmp_affin_mask_t));
+    KMP_AFFINITY_ENABLE(__kmp_num_proc_groups*sizeof(DWORD_PTR));
 #else
-    KMP_AFFINITY_ENABLE(sizeof(kmp_affin_mask_t));
+    KMP_AFFINITY_ENABLE(sizeof(DWORD_PTR));
 #endif
 
     KA_TRACE( 10, (




More information about the Openmp-commits mailing list