Defer Sysman Standby Module Initialization

With this change, init for sysman Standby API would not be done during zeInit.
Rather init and thereby Standby API handle creation would be done only
when user explicitly requests to enumerate handles
using zesDeviceEnumStandbyDomains.

Related-To: LOCI-3127

Signed-off-by: Kulkarni, Ashwin Kumar <ashwin.kumar.kulkarni@intel.com>
This commit is contained in:
Kulkarni, Ashwin Kumar
2022-07-11 10:29:19 +00:00
committed by Compute-Runtime-Automation
parent e1748ad436
commit aadf424476
4 changed files with 13 additions and 6 deletions

View File

@@ -51,7 +51,6 @@ class ZesStandbyFixture : public SysmanDeviceFixture {
deviceHandles.resize(subDeviceCount, nullptr);
Device::fromHandle(device->toHandle())->getSubDevices(&subDeviceCount, deviceHandles.data());
}
pSysmanDeviceImp->pStandbyHandleContext->init(deviceHandles);
}
void TearDown() override {
if (!sysmanUltsEnable) {
@@ -68,6 +67,13 @@ class ZesStandbyFixture : public SysmanDeviceFixture {
}
};
TEST_F(ZesStandbyFixture, GivenStandbyModeFilesNotAvailableWhenCallingEnumerateThenSuccessResultAndZeroCountIsReturned) {
uint32_t count = 0;
ptestSysfsAccess->isStandbyModeFileAvailable = false;
ze_result_t result = zesDeviceEnumStandbyDomains(device, &count, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_EQ(count, 0u);
}
TEST_F(ZesStandbyFixture, GivenComponentCountZeroWhenCallingzesStandbyGetThenNonZeroCountIsReturnedAndVerifyzesStandbyGetCallSucceeds) {
std::vector<zes_standby_handle_t> standbyHandle = {};
uint32_t count = 0;
@@ -326,7 +332,6 @@ class ZesStandbyMultiDeviceFixture : public SysmanMultiDeviceFixture {
deviceHandles.resize(subDeviceCount, nullptr);
Device::fromHandle(device->toHandle())->getSubDevices(&subDeviceCount, deviceHandles.data());
}
pSysmanDeviceImp->pStandbyHandleContext->init(deviceHandles);
}
void TearDown() override {
if (!sysmanUltsEnable) {