mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
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:
committed by
sys_ocldev
parent
135851e218
commit
80f9b5e45a
@@ -11,14 +11,30 @@
|
||||
|
||||
#include "level_zero/core/source/device/device.h"
|
||||
|
||||
#include <chrono>
|
||||
|
||||
namespace L0 {
|
||||
|
||||
void powerGetTimestamp(uint64_t ×tamp) {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user