SWDEV-79445 - HIP improvement
- Make sure only one GPU barrier is issued per dispatch
when memory tracking is disabled
Change-Id: I974569ab42a8835304a2930eef87b561a3750327
[ROCm/clr commit: 481cecec78]
This commit is contained in:
@@ -563,8 +563,7 @@ void VirtualGPU::MemoryDependency::validate(VirtualGPU& gpu, const Memory* memor
|
||||
bool flushL1Cache = false;
|
||||
|
||||
if (maxMemObjectsInQueue_ == 0) {
|
||||
// Flush cache
|
||||
gpu.addBarrier(RgpSqqtBarrierReason::MemDependency);
|
||||
// Return earlier if tracking is disabled
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3549,6 +3548,9 @@ bool VirtualGPU::processMemObjectsHSA(const amd::Kernel& kernel, const_address p
|
||||
addVmMemory(scratch->memObj_);
|
||||
}
|
||||
|
||||
// Synchronize dispatches unconditionally in case memory tracking is disabled
|
||||
memoryDependency().sync(*this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -251,6 +251,13 @@ class VirtualGPU : public device::VirtualDevice {
|
||||
//! Validates memory object on dependency
|
||||
void validate(VirtualGPU& gpu, const Memory* memory, bool readOnly);
|
||||
|
||||
//! Invalidates GPU caches if memory dependency tracking is disabled
|
||||
void sync(VirtualGPU& gpu) const {
|
||||
if (maxMemObjectsInQueue_ == 0) {
|
||||
gpu.addBarrier(RgpSqqtBarrierReason::MemDependency);
|
||||
}
|
||||
}
|
||||
|
||||
//! Clear memory dependency
|
||||
void clear(bool all = true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user