Avoid adding subdevice flag if ReturnSubDevicesAsApiDevices is set

Related-To: LOCI-3656

Signed-off-by: Joshua Santosh Ranjan <joshua.santosh.ranjan@intel.com>
This commit is contained in:
Joshua Santosh Ranjan
2022-11-28 11:55:07 +00:00
committed by Compute-Runtime-Automation
parent ad072b4d5d
commit 522076cf82
18 changed files with 160 additions and 37 deletions

View File

@@ -9,6 +9,8 @@
#include "shared/source/helpers/debug_helpers.h"
#include "level_zero/tools/source/sysman/sysman_imp.h"
namespace L0 {
ze_result_t PowerImp::powerGetProperties(zes_power_properties_t *pProperties) {
@@ -58,10 +60,13 @@ ze_result_t PowerImp::powerSetEnergyThreshold(double threshold) {
}
PowerImp::PowerImp(OsSysman *pOsSysman, ze_device_handle_t handle) : deviceHandle(handle) {
ze_device_properties_t deviceProperties = {};
Device::fromHandle(deviceHandle)->getProperties(&deviceProperties);
pOsPower = OsPower::create(pOsSysman, deviceProperties.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE, deviceProperties.subdeviceId);
uint32_t subdeviceId = std::numeric_limits<uint32_t>::max();
ze_bool_t onSubdevice = false;
SysmanDeviceImp::getSysmanDeviceInfo(deviceHandle, subdeviceId, onSubdevice, false);
pOsPower = OsPower::create(pOsSysman, onSubdevice, subdeviceId);
UNRECOVERABLE_IF(nullptr == pOsPower);
init();
}