Fix async mem clear

Optimization for the fence release removed a sync for mem fill.
Add simple const buffer management forr the filled pattern to avoid
pattern overwriting with the async fills.

Change-Id: I63773ac09ceec31d5396d24570e4647ff096326b


[ROCm/clr commit: 2ce6bbebc4]
This commit is contained in:
German Andryeyev
2020-05-19 17:25:14 -04:00
parent 8789cbafa1
commit e20f40119c
3 changed files with 35 additions and 10 deletions
@@ -1318,6 +1318,8 @@ void VirtualGPU::submitSvmCopyMemory(amd::SvmCopyMemoryCommand& cmd) {
cmd.setStatus(CL_INVALID_OPERATION);
}
} else {
// Stall GPU for CPU access to memory
releaseGpuMemoryFence();
// direct memcpy for FGS enabled system
amd::SvmBuffer::memFill(cmd.dst(), cmd.src(), cmd.srcSize(), 1);
}
@@ -1785,6 +1787,8 @@ void VirtualGPU::submitSvmFillMemory(amd::SvmFillMemoryCommand& cmd) {
// Mark this as the most-recently written cache of the destination
dstMemory->signalWrite(&dev());
} else {
// Stall GPU for CPU access to memory
releaseGpuMemoryFence();
// for FGS capable device, fill CPU memory directly
amd::SvmBuffer::memFill(cmd.dst(), cmd.pattern(), cmd.patternSize(), cmd.times());
}