[Openmp-commits] [PATCH] D112194: [OpenMP] Remove restriction on the thread count for parallel regions

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Mar 21 19:17:25 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG0153ab6dbc33: [OpenMP] Remove restriction on the thread count for parallel regions (authored by jdoerfert).
Herald added subscribers: jplehr, sunshaoce.
Herald added a project: All.

Changed prior to commit:
  https://reviews.llvm.org/D112194?vs=381127&id=507205#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112194/new/

https://reviews.llvm.org/D112194

Files:
  openmp/libomptarget/DeviceRTL/src/Parallelism.cpp


Index: openmp/libomptarget/DeviceRTL/src/Parallelism.cpp
===================================================================
--- openmp/libomptarget/DeviceRTL/src/Parallelism.cpp
+++ openmp/libomptarget/DeviceRTL/src/Parallelism.cpp
@@ -54,7 +54,11 @@
   if (NThreadsICV != 0 && NThreadsICV < NumThreads)
     NumThreads = NThreadsICV;
 
-  // Round down to a multiple of WARPSIZE since it is legal to do so in OpenMP.
+  // SPMD mode allows any number of threads, for generic mode we round down to a
+  // multiple of WARPSIZE since it is legal to do so in OpenMP.
+  if (mapping::isSPMDMode())
+    return NumThreads;
+
   if (NumThreads < mapping::getWarpSize())
     NumThreads = 1;
   else


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112194.507205.patch
Type: text/x-patch
Size: 695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230322/f3d518b1/attachment.bin>


More information about the Openmp-commits mailing list