Defer Sysman Scheduler and Memory Initialization

With this change, init for sysman Scheduler/Memory API would
not be done during zeInit.
init and thereby Scheduler/Memory API handle creation would be done
only when user explicitly requests to enumerate handles
using zesDeviceEnumSchedulers/zesDeviceEnumMemory.

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-26 09:31:22 +00:00
committed by Compute-Runtime-Automation
parent 4967e053b8
commit 1898a82317
10 changed files with 21 additions and 10 deletions

View File

@@ -46,7 +46,7 @@ class SysmanDeviceMemoryFixture : public SysmanDeviceFixture {
deviceHandles.resize(subDeviceCount, nullptr);
Device::fromHandle(device->toHandle())->getSubDevices(&subDeviceCount, deviceHandles.data());
}
pSysmanDeviceImp->pMemoryHandleContext->init(deviceHandles);
getMemoryHandles(0);
}
void TearDown() override {

View File

@@ -58,7 +58,7 @@ class SysmanDeviceMemoryFixture : public SysmanDeviceFixture {
deviceHandles.resize(subDeviceCount, nullptr);
Device::fromHandle(device->toHandle())->getSubDevices(&subDeviceCount, deviceHandles.data());
}
pSysmanDeviceImp->pMemoryHandleContext->init(deviceHandles);
getMemoryHandles(0);
}
void TearDown() override {

View File

@@ -56,7 +56,7 @@ class SysmanDeviceMemoryFixture : public SysmanDeviceFixture {
deviceHandles.resize(subDeviceCount, nullptr);
Device::fromHandle(device->toHandle())->getSubDevices(&subDeviceCount, deviceHandles.data());
}
pSysmanDeviceImp->pMemoryHandleContext->init(deviceHandles);
getMemoryHandles(0);
}
void TearDown() override {

View File

@@ -43,6 +43,11 @@ TEST_F(SysmanDevicePowerFixture, GivenComponentCountZeroWhenEnumeratingPowerDoma
EXPECT_EQ(zesDeviceEnumPowerDomains(device->toHandle(), &count, nullptr), ZE_RESULT_SUCCESS);
EXPECT_EQ(count, powerHandleComponentCount);
}
TEST_F(SysmanDeviceFixture, GivenComponentCountZeroWhenEnumeratingPowerDomainsWhenhwmonInterfaceDoesNotExistThenZeroCountIsReturnedAndVerifySysmanPowerGetCallSucceeds) {
uint32_t count = 0;
EXPECT_EQ(zesDeviceEnumPowerDomains(device->toHandle(), &count, nullptr), ZE_RESULT_SUCCESS);
EXPECT_EQ(count, 0u);
}
TEST_F(SysmanDevicePowerFixture, GivenInvalidComponentCountWhenEnumeratingPowerDomainsWhenhwmonInterfaceExistsThenValidCountIsReturnedAndVerifySysmanPowerGetCallSucceeds) {
uint32_t count = 0;

View File

@@ -84,7 +84,7 @@ class SysmanDeviceSchedulerFixture : public SysmanDeviceFixture {
deviceHandles.resize(subDeviceCount, nullptr);
Device::fromHandle(device->toHandle())->getSubDevices(&subDeviceCount, deviceHandles.data());
}
pSysmanDeviceImp->pSchedulerHandleContext->init(deviceHandles);
getSchedHandles(0);
}
void TearDown() override {