[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 16:28:09 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGee3d9ee49c2e: [OpenMP] Change the nextgen plugin kernel thread count scheme as old plugins' (authored by ye-luo).

Repository:
  rG LLVM Github Monorepo

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

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.484131.patch
Type: text/x-patch
Size: 1089 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20221220/de605e0e/attachment-0001.bin>


More information about the Openmp-commits mailing list