SWDEV-273265 - Fix to wait on a pending dispatch in PAL.

Change-Id: I431cedfef5d5cb727c35ba8e294528017bfe2088
Tá an tiomantas seo le fáil i:
Sourabh Betigeri údaraithe agus Sourabh Betigeri tiomanta 2021-04-06 13:13:07 -04:00
1 tuismitheoir f22ceb0fd8
tiomantas 21ea81d5b9
3 comhad athraithe
+63 -1

Níor tháinig aon chomhaid le do chuardach

+13 -1
Féach ar an gComhad
@@ -1216,7 +1216,7 @@ void VirtualGPU::submitReadMemory(amd::ReadMemoryCommand& vcmd) {
if (size[0] <= dev().settings().pinnedMinXferSize_) {
partial = size[0];
}
// Make first step transfer
// Make first step transfer
if (partial > 0) {
result = blitMgr().readBuffer(*memory, vcmd.destination(), origin, partial);
}
@@ -2596,6 +2596,9 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const
dev().rgpCaptureMgr()->PostDispatch(this);
}
// Mark the flag indicating if a dispatch is outstanding.
state_.hasPendingDispatch_ = true;
return true;
}
@@ -3833,4 +3836,13 @@ void* VirtualGPU::getOrCreateHostcallBuffer() {
}
return hostcallBuffer_;
}
void VirtualGPU::releaseGpuMemoryFence() {
if (isPendingDispatch() && amd::IS_HIP) {
WaitForIdleCompute();
// Reset the status.
state_.hasPendingDispatch_ = false;
}
}
} // namespace pal