Sysman: Add support for device level energy counters

Related-To: LOCI-2724

Signed-off-by: Bellekallu Rajkiran <bellekallu.rajkiran@intel.com>
This commit is contained in:
Bellekallu Rajkiran
2021-12-09 08:02:52 +00:00
committed by Compute-Runtime-Automation
parent 01348451db
commit 4ae2f6e111
6 changed files with 26 additions and 21 deletions

View File

@@ -27,7 +27,12 @@ void PowerHandleContext::createHandle(ze_device_handle_t deviceHandle) {
delete pPower;
}
}
ze_result_t PowerHandleContext::init(std::vector<ze_device_handle_t> &deviceHandles) {
ze_result_t PowerHandleContext::init(std::vector<ze_device_handle_t> &deviceHandles, ze_device_handle_t coreDevice) {
// Create Handle for device level power
if (deviceHandles.size() > 1) {
createHandle(coreDevice);
}
for (const auto &deviceHandle : deviceHandles) {
createHandle(deviceHandle);
}

View File

@@ -42,7 +42,7 @@ struct PowerHandleContext {
PowerHandleContext(OsSysman *pOsSysman) : pOsSysman(pOsSysman){};
~PowerHandleContext();
ze_result_t init(std::vector<ze_device_handle_t> &deviceHandles);
ze_result_t init(std::vector<ze_device_handle_t> &deviceHandles, ze_device_handle_t coreDevice);
ze_result_t powerGet(uint32_t *pCount, zes_pwr_handle_t *phPower);
OsSysman *pOsSysman = nullptr;