diff --git a/openmp/libomptarget/include/device.h b/openmp/libomptarget/include/device.h --- a/openmp/libomptarget/include/device.h +++ b/openmp/libomptarget/include/device.h @@ -334,10 +334,6 @@ std::mutex PendingGlobalsMtx, ShadowMtx; - // NOTE: Once libomp gains full target-task support, this state should be - // moved into the target task in libomp. - std::map LoopTripCnt; - DeviceTy(RTLInfoTy *RTL); // DeviceTy is not copyable DeviceTy(const DeviceTy &D) = delete; diff --git a/openmp/libomptarget/src/LegacyAPI.cpp b/openmp/libomptarget/src/LegacyAPI.cpp --- a/openmp/libomptarget/src/LegacyAPI.cpp +++ b/openmp/libomptarget/src/LegacyAPI.cpp @@ -77,7 +77,7 @@ map_var_info_t *ArgNames, void **ArgMappers) { TIMESCOPE_WITH_IDENT(Loc); __tgt_kernel_arguments KernelArgs{ - 1, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames, ArgMappers, -1}; + 1, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames, ArgMappers, 0}; return __tgt_target_kernel(Loc, DeviceId, -1, -1, HostPtr, &KernelArgs); } @@ -120,7 +120,7 @@ TIMESCOPE_WITH_IDENT(Loc); __tgt_kernel_arguments KernelArgs{ - 1, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames, ArgMappers, -1}; + 1, ArgNum, ArgsBase, Args, ArgSizes, ArgTypes, ArgNames, ArgMappers, 0}; return __tgt_target_kernel(Loc, DeviceId, NumTeams, ThreadLimit, HostPtr, &KernelArgs); } @@ -165,17 +165,6 @@ EXTERN void __kmpc_push_target_tripcount_mapper(ident_t *Loc, int64_t DeviceId, uint64_t LoopTripcount) { TIMESCOPE_WITH_IDENT(Loc); - if (checkDeviceAndCtors(DeviceId, Loc)) { - DP("Not offloading to device %" PRId64 "\n", DeviceId); - return; - } - - DP("__kmpc_push_target_tripcount(%" PRId64 ", %" PRIu64 ")\n", DeviceId, - LoopTripcount); - PM->TblMapMtx.lock(); - PM->Devices[DeviceId]->LoopTripCnt[__kmpc_global_thread_num(NULL)] = - LoopTripcount; - PM->TblMapMtx.unlock(); } EXTERN void __kmpc_push_target_tripcount(int64_t DeviceId, diff --git a/openmp/libomptarget/src/omptarget.cpp b/openmp/libomptarget/src/omptarget.cpp --- a/openmp/libomptarget/src/omptarget.cpp +++ b/openmp/libomptarget/src/omptarget.cpp @@ -1130,26 +1130,6 @@ return nullptr; } -/// Get loop trip count -/// FIXME: This function will not work right if calling -/// __kmpc_push_target_tripcount_mapper in one thread but doing offloading in -/// another thread, which might occur when we call task yield. -uint64_t getLoopTripCount(int64_t DeviceId) { - DeviceTy &Device = *PM->Devices[DeviceId]; - uint64_t LoopTripCount = 0; - - { - std::lock_guard TblMapLock(PM->TblMapMtx); - auto I = Device.LoopTripCnt.find(__kmpc_global_thread_num(NULL)); - if (I != Device.LoopTripCnt.end()) { - LoopTripCount = I->second; - Device.LoopTripCnt.erase(I); - } - } - - return LoopTripCount; -} - /// A class manages private arguments in a target region. class PrivateArgumentManagerTy { /// A data structure for the information of first-private arguments. We can @@ -1512,8 +1492,6 @@ } assert(TargetTable && "Global data has not been mapped\n"); - // FIXME: Use legacy tripcount method if it is '-1'. - Tripcount = Tripcount == -1UL ? getLoopTripCount(DeviceId) : Tripcount; DP("loop trip count is %" PRIu64 ".\n", Tripcount); // We need to keep bases and offsets separate. Sometimes (e.g. in OpenCL) we