[Openmp-commits] [openmp] 2a30c03 - [OpenMP][Offloading] Only get trip count if team construct

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Mon Oct 25 14:16:17 PDT 2021


Author: Shilei Tian
Date: 2021-10-25T17:16:14-04:00
New Revision: 2a30c03c62070d12ce6729441c2c58360dcc1024

URL: https://github.com/llvm/llvm-project/commit/2a30c03c62070d12ce6729441c2c58360dcc1024
DIFF: https://github.com/llvm/llvm-project/commit/2a30c03c62070d12ce6729441c2c58360dcc1024.diff

LOG: [OpenMP][Offloading] Only get trip count if team construct

Reviewed By: grokos

Differential Revision: https://reviews.llvm.org/D112475

Added: 
    

Modified: 
    openmp/libomptarget/src/omptarget.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/src/omptarget.cpp b/openmp/libomptarget/src/omptarget.cpp
index 5ec060976b22c..06370ac8a6785 100644
--- a/openmp/libomptarget/src/omptarget.cpp
+++ b/openmp/libomptarget/src/omptarget.cpp
@@ -1441,9 +1441,6 @@ int target(ident_t *loc, DeviceTy &Device, void *HostPtr, int32_t ArgNum,
     }
   }
 
-  // Get loop trip count
-  uint64_t LoopTripCount = getLoopTripCount(DeviceId);
-
   // Launch device execution.
   void *TgtEntryPtr = TargetTable->EntriesBegin[TM->Index].addr;
   DP("Launching target execution %s with pointer " DPxMOD " (index=%d).\n",
@@ -1455,7 +1452,7 @@ int target(ident_t *loc, DeviceTy &Device, void *HostPtr, int32_t ArgNum,
     if (IsTeamConstruct)
       Ret = Device.runTeamRegion(TgtEntryPtr, &TgtArgs[0], &TgtOffsets[0],
                                  TgtArgs.size(), TeamNum, ThreadLimit,
-                                 LoopTripCount, AsyncInfo);
+                                 getLoopTripCount(DeviceId), AsyncInfo);
     else
       Ret = Device.runRegion(TgtEntryPtr, &TgtArgs[0], &TgtOffsets[0],
                              TgtArgs.size(), AsyncInfo);


        


More information about the Openmp-commits mailing list