[Openmp-commits] [openmp] 1232bc0 - [OpenMP] Fix incorrect use of align instead of round (#196191)

via Openmp-commits openmp-commits at lists.llvm.org
Wed May 6 14:51:19 PDT 2026


Author: Joseph Huber
Date: 2026-05-06T16:51:14-05:00
New Revision: 1232bc01626955f7b47c3b17fc8bca0f7ab9f223

URL: https://github.com/llvm/llvm-project/commit/1232bc01626955f7b47c3b17fc8bca0f7ab9f223
DIFF: https://github.com/llvm/llvm-project/commit/1232bc01626955f7b47c3b17fc8bca0f7ab9f223.diff

LOG: [OpenMP] Fix incorrect use of align instead of round (#196191)

Added: 
    

Modified: 
    openmp/device/src/Mapping.cpp
    openmp/device/src/Reduction.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/device/src/Mapping.cpp b/openmp/device/src/Mapping.cpp
index 5c51da65c8d28..1096e5f496590 100644
--- a/openmp/device/src/Mapping.cpp
+++ b/openmp/device/src/Mapping.cpp
@@ -131,7 +131,7 @@ uint32_t mapping::getBlockIdInKernel(int32_t Dim) {
 }
 
 uint32_t mapping::getNumberOfWarpsInBlock() {
-  return utils::alignUp(mapping::getNumberOfThreadsInBlock(),
+  return utils::roundUp(mapping::getNumberOfThreadsInBlock(),
                         mapping::getWarpSize());
 }
 

diff  --git a/openmp/device/src/Reduction.cpp b/openmp/device/src/Reduction.cpp
index 271d31629d8ee..b1b1e0d2d2917 100644
--- a/openmp/device/src/Reduction.cpp
+++ b/openmp/device/src/Reduction.cpp
@@ -135,7 +135,7 @@ static int32_t nvptx_parallel_reduce_nowait(void *reduce_data,
   //
   // Only L1 parallel region can enter this if condition.
   if (NumThreads > mapping::getWarpSize()) {
-    uint32_t WarpsNeeded = utils::alignUp(NumThreads, mapping::getWarpSize());
+    uint32_t WarpsNeeded = utils::roundUp(NumThreads, mapping::getWarpSize());
     // Gather all the reduced values from each warp
     // to the first warp.
     cpyFct(reduce_data, WarpsNeeded);
@@ -280,7 +280,7 @@ int32_t __kmpc_nvptx_teams_reduce_nowait_v2(
       uint32_t ActiveThreads = kmpcMin(NumRecs, NumThreads);
       if (ActiveThreads > mapping::getWarpSize()) {
         uint32_t WarpsNeeded =
-            utils::alignUp(ActiveThreads, mapping::getWarpSize());
+            utils::roundUp(ActiveThreads, mapping::getWarpSize());
         // Gather all the reduced values from each warp
         // to the first warp.
         cpyFct(reduce_data, WarpsNeeded);


        


More information about the Openmp-commits mailing list