From 324c051f80c36ff20637a043bd24f424afafaf2f Mon Sep 17 00:00:00 2001 From: foreman Date: Thu, 22 Nov 2018 17:23:36 -0500 Subject: [PATCH] P4 to Git Change 1710935 by jatang@jatang_win_pal_lc on 2018/11/22 16:51:02 SWDEV-168522 - Move VirtualGPU::terminate() code into VirtualGPU::~VirtualGPU(). Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#70 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.hpp#20 edit [ROCm/clr commit: 8d717e2de0829dc29d61e75a1b35984de696b286] --- .../rocclr/runtime/device/rocm/rocvirtual.cpp | 32 ++++++++----------- .../rocclr/runtime/device/rocm/rocvirtual.hpp | 2 +- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp b/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp index 02695afa04..ab505ce469 100644 --- a/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp +++ b/projects/clr/rocclr/runtime/device/rocm/rocvirtual.cpp @@ -611,6 +611,19 @@ VirtualGPU::VirtualGPU(Device& device) } VirtualGPU::~VirtualGPU() { + delete blitMgr_; + + // Release the resources of signal + releaseGpuMemoryFence(); + + hsa_status_t err = hsa_queue_destroy(gpu_queue_); + + if (barrier_signal_.handle != 0) { + hsa_signal_destroy(barrier_signal_); + } + + destroyPool(); + releasePinnedMem(); if (timestamp_ != nullptr) { @@ -712,25 +725,6 @@ bool VirtualGPU::create(bool profilingEna) { return true; } -bool VirtualGPU::terminate() { - delete blitMgr_; - - // Release the resources of signal - releaseGpuMemoryFence(); - hsa_status_t err = hsa_queue_destroy(gpu_queue_); - if (err != HSA_STATUS_SUCCESS) { - return false; - } - - if (barrier_signal_.handle != 0) { - hsa_signal_destroy(barrier_signal_); - } - - destroyPool(); - - return true; -} - bool VirtualGPU::initPool(size_t kernarg_pool_size, uint signal_pool_count) { kernarg_pool_size_ = kernarg_pool_size; kernarg_pool_base_ = reinterpret_cast(roc_device_.hostAlloc(kernarg_pool_size_, 1, true)); diff --git a/projects/clr/rocclr/runtime/device/rocm/rocvirtual.hpp b/projects/clr/rocclr/runtime/device/rocm/rocvirtual.hpp index 0b9a0b2da1..0e9e18981b 100644 --- a/projects/clr/rocclr/runtime/device/rocm/rocvirtual.hpp +++ b/projects/clr/rocclr/runtime/device/rocm/rocvirtual.hpp @@ -148,7 +148,7 @@ class VirtualGPU : public device::VirtualDevice { ~VirtualGPU(); bool create(bool profilingEna); - bool terminate(); + bool terminate() { return true; } const Device& dev() const { return roc_device_; } void profilingBegin(amd::Command& command, bool drmProfiling = false);