[Openmp-commits] [PATCH] D121255: [OpenMP][CUDA] Remove hard thread limit in the plugin

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Mar 8 14:30:33 PST 2022


tianshilei1992 created this revision.
tianshilei1992 added reviewers: jdoerfert, jhuber6.
Herald added subscribers: guansong, yaxunl.
Herald added a project: All.
tianshilei1992 requested review of this revision.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

OpenMP specification doesn't limit the max number of threads a team can
use. Like we did in D119313 <https://reviews.llvm.org/D119313> to remove the hard limit of number of teams, we also
do it for number of threads.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121255

Files:
  openmp/libomptarget/plugins/cuda/src/rtl.cpp


Index: openmp/libomptarget/plugins/cuda/src/rtl.cpp
===================================================================
--- openmp/libomptarget/plugins/cuda/src/rtl.cpp
+++ openmp/libomptarget/plugins/cuda/src/rtl.cpp
@@ -343,7 +343,6 @@
   /// Number of initial events for each device.
   int NumInitialEvents = 8;
 
-  static constexpr const int32_t HardThreadLimit = 1024;
   static constexpr const int32_t DefaultNumTeams = 128;
   static constexpr const int32_t DefaultNumThreads = 128;
 
@@ -680,12 +679,6 @@
            DeviceData[DeviceId].ThreadsPerBlock, EnvTeamThreadLimit);
         DeviceData[DeviceId].ThreadsPerBlock = EnvTeamThreadLimit;
       }
-      if (DeviceData[DeviceId].ThreadsPerBlock > DeviceRTLTy::HardThreadLimit) {
-        DP("Max CUDA threads per block %d exceeds the hard thread limit %d, "
-           "capping at the hard limit\n",
-           DeviceData[DeviceId].ThreadsPerBlock, DeviceRTLTy::HardThreadLimit);
-        DeviceData[DeviceId].ThreadsPerBlock = DeviceRTLTy::HardThreadLimit;
-      }
     }
 
     // Get and set warp size


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121255.413939.patch
Type: text/x-patch
Size: 1074 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220308/9cb86be2/attachment.bin>


More information about the Openmp-commits mailing list