[Openmp-commits] [PATCH] D103923: [OpenMP] Add thread limit environment variable support to plugins

George Rokos via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jun 8 12:36:18 PDT 2021


grokos added inline comments.


================
Comment at: openmp/libomptarget/plugins/cuda/src/rtl.cpp:623
+                   MaxBlockDimX > EnvTeamThreadLimit) {
+          DP("Max CUDA threads per block %d exceeds the hard thread limit %d "
+             "set by OMP_TEAMS_THREAD_LIMIT, capping at the limit\n",
----------------
exceeds the env team thread limit


================
Comment at: openmp/libomptarget/plugins/cuda/src/rtl.cpp:627-632
+        } else {
+          DP("Max CUDA threads per block %d exceeds the hard thread limit %d, "
+             "capping at the hard limit\n",
+             MaxBlockDimX, DeviceRTLTy::HardThreadLimit);
+          DeviceData[DeviceId].ThreadsPerBlock = DeviceRTLTy::HardThreadLimit;
+        }
----------------
This `else` does not take care of this scenario correctly:

`EnvTeamThreadLimit < HardThreadLimit < MaxBlockDimX`

`MaxBlockDimX` will be set to `HardThreadLimit` whereas it should be set to `EnvTeamThreadLimit`.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103923



More information about the Openmp-commits mailing list