[Openmp-commits] [PATCH] D140352: [OpenMP] Change the nextgen plugin kernel thread count scheme as old plugins'

Ye Luo via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Dec 19 15:33:08 PST 2022


ye-luo created this revision.
Herald added subscribers: guansong, yaxunl.
Herald added a project: All.
ye-luo requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140352

Files:
  openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp


Index: openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
===================================================================
--- openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
+++ openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
@@ -36,8 +36,6 @@
 Error GenericKernelTy::init(GenericDeviceTy &GenericDevice,
                             DeviceImageTy &Image) {
   PreferredNumThreads = getDefaultNumThreads(GenericDevice);
-  if (isGenericMode())
-    PreferredNumThreads += GenericDevice.getWarpSize();
 
   MaxNumThreads = GenericDevice.getThreadLimit();
 
@@ -92,6 +90,9 @@
 
 uint32_t GenericKernelTy::getNumThreads(GenericDeviceTy &GenericDevice,
                                         uint32_t ThreadLimitClause) const {
+  if (ThreadLimitClause > 0 && isGenericMode())
+    ThreadLimitClause += GenericDevice.getWarpSize();
+
   return std::min(MaxNumThreads, (ThreadLimitClause > 0) ? ThreadLimitClause
                                                          : PreferredNumThreads);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140352.484111.patch
Type: text/x-patch
Size: 1089 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20221219/9f787d73/attachment.bin>


More information about the Openmp-commits mailing list