[Openmp-commits] [PATCH] D82301: [OpenMP][NFC] Cleanup: put two more usages of __kmp_mic_type under KMP_MIC_SUPPORTED macro.

Andrey Churbanov via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Jun 22 07:30:24 PDT 2020


AndreyChurbanov created this revision.
AndreyChurbanov added reviewers: hbae, tlwilmar.
AndreyChurbanov added a project: OpenMP.
Herald added subscribers: openmp-commits, sstefan1, guansong, yaxunl.
Herald added a reviewer: jdoerfert.

The __kmp_mic_type variable declared under KMP_MIC_SUPPORTED macro, thus all its usages must be guarded by the same macro.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82301

Files:
  openmp/runtime/src/kmp_affinity.cpp


Index: openmp/runtime/src/kmp_affinity.cpp
===================================================================
--- openmp/runtime/src/kmp_affinity.cpp
+++ openmp/runtime/src/kmp_affinity.cpp
@@ -1968,7 +1968,8 @@
   __kmp_hier_max_units[kmp_hier_layer_e::LAYER_THREAD + 1] =
       nPackages * nCoresPerPkg * __kmp_nThreadsPerCore;
   __kmp_hier_max_units[kmp_hier_layer_e::LAYER_L1 + 1] = __kmp_ncores;
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_WINDOWS)
+#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_WINDOWS) && \
+    KMP_MIC_SUPPORTED
   if (__kmp_mic_type >= mic3)
     __kmp_hier_max_units[kmp_hier_layer_e::LAYER_L2 + 1] = __kmp_ncores / 2;
   else
@@ -1982,7 +1983,8 @@
   __kmp_hier_threads_per[kmp_hier_layer_e::LAYER_THREAD + 1] = 1;
   __kmp_hier_threads_per[kmp_hier_layer_e::LAYER_L1 + 1] =
       __kmp_nThreadsPerCore;
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_WINDOWS)
+#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_WINDOWS) && \
+    KMP_MIC_SUPPORTED
   if (__kmp_mic_type >= mic3)
     __kmp_hier_threads_per[kmp_hier_layer_e::LAYER_L2 + 1] =
         2 * __kmp_nThreadsPerCore;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82301.272424.patch
Type: text/x-patch
Size: 1185 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200622/6719cb89/attachment.bin>


More information about the Openmp-commits mailing list