Changeset View
Changeset View
Standalone View
Standalone View
openmp/libomptarget/src/rtl.cpp
Show First 20 Lines • Show All 438 Lines • ▼ Show 20 Lines | for (auto *R : UsedRTLs) { | ||||
// if its PendingCtors list has been emptied. | // if its PendingCtors list has been emptied. | ||||
for (int32_t I = 0; I < FoundRTL->NumberOfDevices; ++I) { | for (int32_t I = 0; I < FoundRTL->NumberOfDevices; ++I) { | ||||
DeviceTy &Device = *PM->Devices[FoundRTL->Idx + I]; | DeviceTy &Device = *PM->Devices[FoundRTL->Idx + I]; | ||||
Device.PendingGlobalsMtx.lock(); | Device.PendingGlobalsMtx.lock(); | ||||
if (Device.PendingCtorsDtors[Desc].PendingCtors.empty()) { | if (Device.PendingCtorsDtors[Desc].PendingCtors.empty()) { | ||||
AsyncInfoTy AsyncInfo(Device); | AsyncInfoTy AsyncInfo(Device); | ||||
for (auto &Dtor : Device.PendingCtorsDtors[Desc].PendingDtors) { | for (auto &Dtor : Device.PendingCtorsDtors[Desc].PendingDtors) { | ||||
int Rc = target(nullptr, Device, Dtor, 0, nullptr, nullptr, nullptr, | int Rc = target(nullptr, Device, Dtor, 0, nullptr, nullptr, nullptr, | ||||
nullptr, nullptr, nullptr, 1, 1, true /*team*/, | nullptr, nullptr, nullptr, 1, 1, 0, true /*team*/, | ||||
AsyncInfo); | AsyncInfo); | ||||
if (Rc != OFFLOAD_SUCCESS) { | if (Rc != OFFLOAD_SUCCESS) { | ||||
DP("Running destructor " DPxMOD " failed.\n", DPxPTR(Dtor)); | DP("Running destructor " DPxMOD " failed.\n", DPxPTR(Dtor)); | ||||
} | } | ||||
} | } | ||||
// Remove this library's entry from PendingCtorsDtors | // Remove this library's entry from PendingCtorsDtors | ||||
Device.PendingCtorsDtors.erase(Desc); | Device.PendingCtorsDtors.erase(Desc); | ||||
// All constructors have been issued, wait for them now. | // All constructors have been issued, wait for them now. | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |