(Sysman):Changes made in engine API.

Replacing normal pointers by smart pointers in engine module of L0 sysman.

Related-To: LOCI-2810

Signed-off-by: Singh, Prasoon <prasoon.singh@intel.com>
This commit is contained in:
Singh, Prasoon
2023-03-10 19:00:55 +00:00
committed by Compute-Runtime-Automation
parent b161af5886
commit 49827b7122
11 changed files with 20 additions and 67 deletions

View File

@@ -58,10 +58,6 @@ class ZesEngineFixture : public SysmanDeviceFixture {
pLinuxSysmanImp->pPmuInterface = pPmuInterface.get();
pFsAccess->mockReadVal = 23;
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
uint32_t subDeviceCount = 0;
// We received a device handle. Check for subdevices in this device
@@ -181,8 +177,6 @@ TEST_F(ZesEngineFixture, GivenTestDiscreteDevicesAndValidEngineHandleWhenCalling
auto pOsEngineTest2 = OsEngine::create(pOsSysman, ZES_ENGINE_GROUP_RENDER_SINGLE, 0u, 0u, false);
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pOsEngineTest2->getActivity(&stats));
delete pOsEngineTest1;
delete pOsEngineTest2;
}
TEST_F(ZesEngineFixture, GivenTestIntegratedDevicesAndValidEngineHandleWhenCallingZesEngineGetActivityAndPMUGetEventTypeFailsThenVerifyEngineGetActivityReturnsFailure) {
@@ -192,7 +186,6 @@ TEST_F(ZesEngineFixture, GivenTestIntegratedDevicesAndValidEngineHandleWhenCalli
auto pOsEngineTest1 = OsEngine::create(pOsSysman, ZES_ENGINE_GROUP_RENDER_SINGLE, 0u, 0u, false);
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pOsEngineTest1->getActivity(&stats));
delete pOsEngineTest1;
}
TEST_F(ZesEngineFixture, GivenValidEngineHandleWhenCallingZesEngineGetActivityAndPmuReadFailsThenVerifyEngineGetActivityReturnsFailure) {

View File

@@ -58,10 +58,6 @@ class ZesEngineFixture : public SysmanDeviceFixture {
pLinuxSysmanImp->pDrm = pDrm.get();
pLinuxSysmanImp->pPmuInterface = pPmuInterface.get();
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
uint32_t subDeviceCount = 0;
// We received a device handle. Check for subdevices in this device
@@ -210,8 +206,6 @@ TEST_F(ZesEngineFixture, GivenTestDiscreteDevicesAndValidEngineHandleWhenCalling
auto pOsEngineTest2 = OsEngine::create(pOsSysman, ZES_ENGINE_GROUP_RENDER_SINGLE, 0u, 0u, false);
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pOsEngineTest2->getActivity(&stats));
delete pOsEngineTest1;
delete pOsEngineTest2;
}
TEST_F(ZesEngineFixture, GivenUnknownEngineTypeThengetEngineGroupFromTypeReturnsGroupAllEngineGroup) {
@@ -226,7 +220,6 @@ TEST_F(ZesEngineFixture, GivenTestIntegratedDevicesAndValidEngineHandleWhenCalli
auto pOsEngineTest1 = OsEngine::create(pOsSysman, ZES_ENGINE_GROUP_RENDER_SINGLE, 0u, 0u, false);
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pOsEngineTest1->getActivity(&stats));
delete pOsEngineTest1;
}
TEST_F(ZesEngineFixture, GivenValidEngineHandleWhenCallingZesEngineGetActivityAndPmuReadFailsThenVerifyEngineGetActivityReturnsFailure) {
@@ -261,9 +254,6 @@ TEST_F(ZesEngineFixture, GivenValidOsSysmanPointerWhenRetrievingEngineTypeAndIns
TEST_F(ZesEngineFixture, GivenHandleQueryItemCalledWithInvalidEngineTypeThenzesDeviceEnumEngineGroupsSucceeds) {
auto drm = std::make_unique<DrmMockEngine>(const_cast<NEO::RootDeviceEnvironment &>(neoDevice->getRootDeviceEnvironment()));
pLinuxSysmanImp->pDrm = drm.get();
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
pSysmanDeviceImp->pEngineHandleContext->init(deviceHandles);
uint32_t count = 0;
@@ -276,10 +266,6 @@ TEST_F(ZesEngineFixture, GivenHandleQueryItemCalledWhenPmuInterfaceOpenFailsThen
pFsAccess->mockReadVal = true;
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
pSysmanDeviceImp->pEngineHandleContext->init(deviceHandles);
uint32_t count = 0;
@@ -302,9 +288,6 @@ TEST_F(ZesEngineFixture, GivenValidEngineHandleAndHandleCountZeroWhenCallingReIn
EXPECT_EQ(ZE_RESULT_SUCCESS, zesDeviceEnumEngineGroups(device->toHandle(), &count, NULL));
EXPECT_EQ(count, handleComponentCount);
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
pLinuxSysmanImp->reInitSysmanDeviceResources();
@@ -350,10 +333,6 @@ class ZesEngineMultiFixture : public SysmanMultiDeviceFixture {
pDrm->mockReadSysmanQueryEngineInfoMultiDevice = true;
pSysfsAccess->mockReadSymLinkSuccess = true;
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
uint32_t subDeviceCount = 0;
// We received a device handle. Check for subdevices in this device
@@ -443,10 +422,6 @@ TEST_F(ZesEngineMultiFixture, GivenHandleQueryItemCalledWhenPmuInterfaceOpenFail
pFsAccess->mockReadVal = true;
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
pSysmanDeviceImp->pEngineHandleContext->init(deviceHandles);
uint32_t count = 0;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -30,10 +30,6 @@ class SysmanDeviceEngineFixture : public SysmanDeviceFixture {
pOriginalKmdSysManager = pWddmSysmanImp->pKmdSysManager;
pWddmSysmanImp->pKmdSysManager = pKmdSysManager.get();
for (auto handle : pSysmanDeviceImp->pEngineHandleContext->handleList) {
delete handle;
}
pSysmanDeviceImp->pEngineHandleContext->handleList.clear();
}
@@ -96,10 +92,9 @@ TEST_F(SysmanDeviceEngineFixture, GivenComponentCountZeroWhenEnumeratingEngineGr
}
TEST_F(SysmanDeviceEngineFixture, GivenUnsupportedEngineHandleWhenGettingEngineActivityThenFailureIsReturned) {
WddmEngineImp *pEngineImp = new WddmEngineImp(pOsSysman, ZES_ENGINE_GROUP_3D_ALL, 0, 0);
std::unique_ptr<WddmEngineImp> pEngineImp = std::make_unique<WddmEngineImp>(pOsSysman, ZES_ENGINE_GROUP_3D_ALL, 0, 0);
zes_engine_stats_t pStats = {};
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, pEngineImp->getActivity(&pStats));
delete pEngineImp;
}
TEST_F(SysmanDeviceEngineFixture, GivenValidHandleGetPropertiesThenCorrectEngineGroupIsReturned) {