P4 to Git Change 1451293 by gandryey@gera-w8 on 2017/08/24 13:37:00

SWDEV-129129 - [[CQE OCL][Vega vs Fiji] Upto 12% Performance drop observed on VEGA10 compared to FIJI while running BlackMagic Davinci Resolve
	The app creates/destroys hundred resources each frame. PAL path was removing the destroyed resources from the resident list, although the resource was kept in the cache. This change does the follwoing:
	- Switch TS tracking from a map in VirtualGPU to resource
	- Don't remove references until the actual memory destruction
	- Add a residency threshold to avoid OS resident/eviction calls

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/blit.hpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.cpp#14 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.hpp#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldefs.hpp#19 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#50 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.hpp#17 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#35 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.hpp#13 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#14 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#46 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.hpp#19 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#30 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.hpp#13 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#52 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#28 edit


[ROCm/clr commit: b82be1113f]
Este commit está contenido en:
foreman
2017-08-24 13:51:55 -04:00
padre 199350387f
commit b05f148ae5
Se han modificado 15 ficheros con 387 adiciones y 317 borrados
@@ -581,7 +581,10 @@ Device::Device()
heapInitComplete_(false),
xferQueue_(nullptr),
globalScratchBuf_(nullptr),
srdManager_(nullptr) {}
srdManager_(nullptr),
lockResourceOps_(nullptr),
resourceList_(nullptr)
{}
Device::~Device() {
// remove the HW debug manager
@@ -625,6 +628,8 @@ Device::~Device() {
delete vgpusAccess_;
delete scratchAlloc_;
delete mapCacheOps_;
delete lockResourceOps_;
delete resourceList_;
if (context_ != nullptr) {
context_->release();
@@ -639,7 +644,10 @@ bool Device::create(Pal::IDevice* device) {
if (!amd::Device::create()) {
return false;
}
resourceList_ = new std::list<GpuMemoryReference*>();
if (nullptr == resourceList_) {
return false;
}
appProfile_.init();
device_ = device;
Pal::Result result;
@@ -749,6 +757,11 @@ bool Device::create(Pal::IDevice* device) {
return false;
}
lockResourceOps_ = new amd::Monitor("Resource List Ops Lock", true);
if (nullptr == lockResourceOps_) {
return false;
}
lockForInitHeap_ = new amd::Monitor("Async Ops Lock For Initialization of Heap Resource", true);
if (nullptr == lockForInitHeap_) {
return false;
@@ -2075,9 +2088,9 @@ bool Device::createBlitProgram() {
return result;
}
void Device::SrdManager::fillResourceList(std::vector<const Memory*>& memList) {
void Device::SrdManager::fillResourceList(VirtualGPU& gpu) {
for (uint i = 0; i < pool_.size(); ++i) {
memList.push_back(pool_[i].buf_);
gpu.addVmMemory(pool_[i].buf_);
}
}