SWDEV-359548 - Enqueue marker if fence is dirty

The marker would flush any caches.

Change-Id: I5f990285fb3c3a3e8d5d0b2a2d5a9f1fdcea435c


[ROCm/clr commit: da88091ba4]
Этот коммит содержится в:
Saleel Kudchadker
2022-10-03 09:11:09 -07:00
коммит произвёл Maneesh Gupta
родитель a0981e4ccd
Коммит 409c07e3d8
+3 -1
Просмотреть файл
@@ -200,6 +200,7 @@ void Stream::destroyAllStreams(int deviceId) {
// ================================================================================================
void iHipWaitActiveStreams(amd::HostQueue* blocking_queue, bool wait_null_stream) {
amd::Command::EventWaitList eventWaitList(0);
bool submitMarker = 0;
{
amd::ScopedLock lock(streamSetLock);
@@ -223,6 +224,7 @@ void iHipWaitActiveStreams(amd::HostQueue* blocking_queue, bool wait_null_stream
if (!ready) {
ready = (command->status() == CL_COMPLETE);
}
submitMarker |= active_queue->vdev()->isFenceDirty();
// Check the current active status
if (!ready) {
command->notifyCmdQueue();
@@ -240,7 +242,7 @@ void iHipWaitActiveStreams(amd::HostQueue* blocking_queue, bool wait_null_stream
}
// Check if we have to wait anything
if (eventWaitList.size() > 0) {
if (eventWaitList.size() > 0 || submitMarker) {
amd::Command* command = new amd::Marker(*blocking_queue, kMarkerDisableFlush, eventWaitList);
if (command != nullptr) {
command->enqueue();