add support for zetSysmanPowerGetEnergyCounter

-- add ULT support for power

Change-Id: I37ebebb62c3433a1efe106d6b6546955a2d6effb
Signed-off-by: SaiKishore Konda <saikishore.konda@intel.com>
This commit is contained in:
SaiKishore Konda
2020-05-15 06:05:22 -04:00
committed by sys_ocldev
parent 135851e218
commit 80f9b5e45a
10 changed files with 172 additions and 17 deletions

View File

@@ -11,14 +11,30 @@
#include "level_zero/core/source/device/device.h"
#include <chrono>
namespace L0 {
void powerGetTimestamp(uint64_t &timestamp) {
std::chrono::time_point<std::chrono::steady_clock> ts = std::chrono::steady_clock::now();
timestamp = std::chrono::duration_cast<std::chrono::microseconds>(ts.time_since_epoch()).count();
}
ze_result_t PowerImp::powerGetProperties(zet_power_properties_t *pProperties) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
ze_result_t PowerImp::powerGetEnergyCounter(zet_power_energy_counter_t *pEnergy) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
ze_result_t result = pOsPower->getEnergyCounter(pEnergy->energy);
if (result != ZE_RESULT_SUCCESS) {
return result;
}
powerGetTimestamp(pEnergy->timestamp);
return result;
}
ze_result_t PowerImp::powerGetLimits(zet_power_sustained_limit_t *pSustained, zet_power_burst_limit_t *pBurst, zet_power_peak_limit_t *pPeak) {