Skip to content

Commit c340f60

Browse files
authored
[offload] Fix asserts in kernel record replay (#192379)
This commit fixes issues introduced in PR #190588
1 parent c87a60f commit c340f60

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

offload/libomptarget/omptarget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,9 +2422,9 @@ int target_replay(ident_t *Loc, DeviceTy &Device, void *HostPtr,
24222422
// Retrieve the target table for each symbol.
24232423
{
24242424
std::lock_guard<std::mutex> TrlTblLock(PM->TrlTblMtx);
2425-
assert(TM->Table->TargetsTable.size() > (size_t)DeviceId &&
2426-
"Not expecting a device ID outside the table's bounds!");
24272425
for (auto &S : Symbols) {
2426+
assert(S.TM->Table->TargetsTable.size() > (size_t)DeviceId &&
2427+
"Not expecting a device ID outside the table's bounds!");
24282428
S.TargetTable = S.TM->Table->TargetsTable[DeviceId];
24292429
assert(S.TargetTable && "Global data has not been mapped\n");
24302430
}

offload/plugins-nextgen/common/src/RecordReplay.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ Error NativeRecordReplayTy::recordGlobals(const std::string &Filename) {
315315
}
316316
assert(BufferPtr == GlobalsMB->get()->getBufferEnd() &&
317317
"Buffer over or under-filled.");
318-
assert(TotalSize ==
319-
utils::getPtrDiff(BufferPtr, GlobalsMB->get()->getBufferStart()) &&
318+
assert(TotalSize == (uint64_t)utils::getPtrDiff(
319+
BufferPtr, GlobalsMB->get()->getBufferStart()) &&
320320
"Buffer size mismatch.");
321321

322322
StringRef GlobalsMemory(GlobalsMB.get()->getBufferStart(), TotalSize);

0 commit comments

Comments
 (0)