From bf66d7bc032d9bd7f45a0cea1cb7424b605f153f Mon Sep 17 00:00:00 2001 From: foreman Date: Mon, 11 Dec 2017 11:59:15 -0500 Subject: [PATCH] P4 to Git Change 1492748 by gandryey@gera-w8 on 2017/12/11 11:53:55 SWDEV-139828 - [OCL] OCL runtime hang in multithread app - This issue is a regression after Davinci optimizations. Execution lock should be applied for the engine's wait only, since the resource cache has own lock protection that can conflict with the execution lock Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#65 edit [ROCm/clr commit: 175f01c4208d30ea670d0e7f8001a7bc9f68f14b] --- projects/clr/rocclr/runtime/device/pal/palvirtual.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp b/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp index 383c96c42e..112db3df76 100644 --- a/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp +++ b/projects/clr/rocclr/runtime/device/pal/palvirtual.cpp @@ -2716,9 +2716,12 @@ bool VirtualGPU::waitAllEngines(CommandBatch* cb) { } void VirtualGPU::waitEventLock(CommandBatch* cb) { - // Make sure VirtualGPU has an exclusive access to the resources - amd::ScopedLock lock(execution()); - bool earlyDone = waitAllEngines(cb); + bool earlyDone = false; + { + // Make sure VirtualGPU has an exclusive access to the resources + amd::ScopedLock lock(execution()); + earlyDone = waitAllEngines(cb); + } // Free resource cache if we have too many entries //! \note we do it here, when all engines are idle,