Skip to content

Commit d5b5ddd

Browse files
mhalkronlieb
authored andcommitted
[offload] Fix potential D2D transfer fail
In case of a D2D transfer where no release of an intermediate buffer is necessary, no ActionFunction is set. But this circumstance also leads to a fail. Now we only report an 'empty' ActionFunction. Change-Id: I89cc5f415d9d7ca914266b10824e4d709161589a
1 parent 23bbdfe commit d5b5ddd

File tree

1 file changed

+6
-1
lines changed
  • offload/plugins-nextgen/amdgpu/src

1 file changed

+6
-1
lines changed

offload/plugins-nextgen/amdgpu/src/rtl.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,11 @@ struct AMDGPUStreamTy {
16601660
} else if (ActionFunction == releaseSignalAction) {
16611661
if (auto Err = releaseSignalAction(&ActionArgs))
16621662
return Err;
1663+
} else if (ActionFunction == nullptr) {
1664+
// For example a Device-to-Device transfer will not require a buffer
1665+
// release and the ActionFunction will be a nullptr. Hence, we should
1666+
// generally pass in this scenario (but still log the info).
1667+
DP("performAction: ActionFunction was nullptr\n");
16631668
} else {
16641669
return Plugin::error("Unknown action function!");
16651670
}
@@ -2203,7 +2208,7 @@ struct AMDGPUStreamTy {
22032208

22042209
#ifdef OMPT_SUPPORT
22052210
if (OmptInfo) {
2206-
DP("OMPT-Async: Registering data timing in pushMemoryCopyH2DAsync\n");
2211+
DP("OMPT-Async: Registering data timing in pushMemoryCopyD2DAsync\n");
22072212
// Capture the time the data transfer required for the d2h transfer.
22082213
if (auto Err = Slots[Curr].schedOmptAsyncD2HTransferTiming(
22092214
Agent, OutputSignal, TicksToTime, std::move(OmptInfo)))

0 commit comments

Comments
 (0)