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: 8d717e2de0]
This commit is contained in:
foreman
2018-11-22 17:23:36 -05:00
parent fe73459442
commit 324c051f80
2 changed files with 14 additions and 20 deletions
@@ -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<char*>(roc_device_.hostAlloc(kernarg_pool_size_, 1, true));