P4 to Git Change 1393335 by gandryey@gera-w8 on 2017/03/31 13:43:08

SWDEV-79445 - OCL generic changes and code clean-up
	- Implement the right fix for SWDEV-115408 and revert CL#1392885. PAL fence reset should occur after WaitForFences(), since there is a possible delay between TS event and OS event

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#45 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#19 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#267 edit


[ROCm/clr commit: a708eb45ce]
This commit is contained in:
foreman
2017-03-31 13:50:51 -04:00
parent 02ca073506
commit d3ac3503e1
3 changed files with 11 additions and 19 deletions
@@ -246,6 +246,12 @@ VirtualGPU::Queue::flush()
}
}
// Reset the fence. PAL will reset OS event
if (Pal::Result::Success != iDev_->ResetFences(1, &iCmdFences_[cmdBufIdSlot_])) {
LogError("PAL failed to reset a fence!");
return false;
}
Pal::SubmitInfo submitInfo = {};
submitInfo.cmdBufferCount = 1;
submitInfo.ppCmdBuffers = &iCmdBuffs_[cmdBufIdSlot_];
@@ -279,7 +285,8 @@ VirtualGPU::Queue::flush()
cmdBufIdSlot_ = cmdBufIdCurrent_ % MaxCmdBuffers;
// Make sure the slot isn't busy
waifForFence(cmdBufIdSlot_);
constexpr bool IbReuse = true;
waifForFence(cmdBufIdSlot_, IbReuse);
// Progress retired TS
if ((cmdBufIdCurrent_ > MaxCmdBuffers) &&
@@ -287,12 +294,6 @@ VirtualGPU::Queue::flush()
cmbBufIdRetired_ = cmdBufIdCurrent_ - MaxCmdBuffers;
}
if (Pal::Result::Success !=
iDev_->ResetFences(1, &iCmdFences_[cmdBufIdSlot_])) {
LogError("PAL failed to reset a fence!");
return false;
}
// Reset command buffer, so CB chunks could be reused
if (Pal::Result::Success != iCmdBuffs_[cmdBufIdSlot_]->Reset(nullptr, false)) {
LogError("PAL failed CB reset!");