From 8d82c5e97b71537bbf94e854955ea80a2142013b Mon Sep 17 00:00:00 2001 From: foreman Date: Tue, 19 Jun 2018 09:53:09 -0400 Subject: [PATCH] P4 to Git Change 1570053 by jatang@jatang-opencl-hsa-stg5 on 2018/06/19 09:47:32 SWDEV-155306 - Restore ClockMode when the last queue is destroyed. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#110 edit --- rocclr/runtime/device/pal/palvirtual.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rocclr/runtime/device/pal/palvirtual.cpp b/rocclr/runtime/device/pal/palvirtual.cpp index 59b4ff3953..feff0b95ca 100644 --- a/rocclr/runtime/device/pal/palvirtual.cpp +++ b/rocclr/runtime/device/pal/palvirtual.cpp @@ -956,6 +956,14 @@ VirtualGPU::~VirtualGPU() { //! The first queue is reserved for the transfers on device if (static_cast(gpuDevice_.numOfVgpus_ - 1) <= 1) { gpuDevice_.destroyScratchBuffers(); + + // Restore the ClockMode back to Default. + // This will be removed once KMD/PPLIB supports restoring the ClockMode when KMD + // detects the OCL process is gone. + Pal::SetClockModeInput input = {}; + Pal::SetClockModeOutput output = {}; + input.clockMode = Pal::DeviceClockMode::Default; + dev().iDev()->SetClockMode(input, &output); } // Destroy BlitManager object