P4 to Git Change 1535708 by rili@rili-ocl on 2018/04/02 17:07:56

SWDEV-147340 - Added function UpdateAppPowerProfile() that notices KMD to update applicaiton profile.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/appprofile.cpp#20 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/appprofile.hpp#13 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#82 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#45 edit
... //depot/stg/opencl/drivers/opencl/runtime/os/os.hpp#31 edit
... //depot/stg/opencl/drivers/opencl/runtime/os/os_posix.cpp#43 edit
... //depot/stg/opencl/drivers/opencl/runtime/os/os_win32.cpp#49 edit
This commit is contained in:
foreman
2018-04-02 17:15:51 -04:00
parent e7fb98dd94
commit 8dd0ed0240
7 changed files with 49 additions and 14 deletions
+14 -1
View File
@@ -14,6 +14,7 @@
#include "device/pal/paltimestamp.hpp"
#include "device/pal/palblit.hpp"
#include "device/pal/paldebugger.hpp"
#include "device/appprofile.hpp"
#include "hsa.h"
#include "amd_hsa_kernel_code.h"
#include "amd_hsa_queue.h"
@@ -90,7 +91,7 @@ VirtualGPU::Queue* VirtualGPU::Queue::Create(Pal::IDevice* palDev, Pal::QueueTyp
delete queue;
return nullptr;
}
queue->UpdateAppPowerProfile();
address addrCmd = addrQ + qSize;
address addrF = addrCmd + MaxCmdBuffers * cmdSize;
Pal::CmdBufferBuildInfo cmdBuildInfo = {};
@@ -146,6 +147,18 @@ VirtualGPU::Queue::~Queue() {
}
}
Pal::Result VirtualGPU::Queue::UpdateAppPowerProfile()
{
std::wstring wsAppPathAndFileName = Device::appProfile()->wsAppPathAndFileName();
const wchar_t* wAppPathAndName = wsAppPathAndFileName.c_str();
// Find the last occurance of the '\\' character and extract the name of the application as wide char.
const wchar_t* wAppNamePtr = wcsrchr(wAppPathAndName, '\\');
const wchar_t* wAppName = wAppNamePtr ? wAppNamePtr + 1 : wAppPathAndName;
return iQueue_->UpdateAppPowerProfile(wAppName, wAppPathAndName);
}
void VirtualGPU::Queue::addCmdMemRef(GpuMemoryReference* mem) {
Pal::IGpuMemory* iMem = mem->iMem();
auto it = memReferences_.find(mem);