[Openmp-commits] [PATCH] D41000: AArch64: fix cpuinfo issues

Paul Osmialowski via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Dec 7 23:10:51 PST 2017


pawosm01 created this revision.
pawosm01 added a project: OpenMP.
Herald added subscribers: openmp-commits, kristof.beyls, rengolin, aemerson.

This fixes two issues:

1. Not using help from sysfs does not make sense on AArch64 Linux systems
2. There are two /proc/cpuinfo layots in use for AArch64: old and new. The old one has all 'processor : n' lines in one section, hence checking for duplications does not make sense.


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D41000

Files:
  runtime/src/kmp_affinity.cpp
  runtime/src/kmp_os.h


Index: runtime/src/kmp_os.h
===================================================================
--- runtime/src/kmp_os.h
+++ runtime/src/kmp_os.h
@@ -860,8 +860,12 @@
 
 // Switches for OSS builds
 #ifndef USE_SYSFS_INFO
+#if KMP_ARCH_AARCH64
+#define USE_SYSFS_INFO 1
+#else
 #define USE_SYSFS_INFO 0
 #endif
+#endif
 #ifndef USE_CMPXCHG_FIX
 #define USE_CMPXCHG_FIX 1
 #endif
Index: runtime/src/kmp_affinity.cpp
===================================================================
--- runtime/src/kmp_affinity.cpp
+++ runtime/src/kmp_affinity.cpp
@@ -2028,7 +2028,11 @@
         if ((p == NULL) || (KMP_SSCANF(p + 1, "%u\n", &val) != 1))
           goto no_val;
         if (threadInfo[num_avail][osIdIndex] != UINT_MAX)
+#if KMP_ARCH_AARCH64
+          num_avail++;
+#else
           goto dup_field;
+#endif
         threadInfo[num_avail][osIdIndex] = val;
 #if KMP_OS_LINUX && USE_SYSFS_INFO
         char path[256];


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41000.126093.patch
Type: text/x-patch
Size: 920 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20171208/e15be66a/attachment.bin>


More information about the Openmp-commits mailing list