(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

@@ -24,11 +24,9 @@ EngineHandleContext::~EngineHandleContext() {
}
void EngineHandleContext::createHandle(zes_engine_group_t engineType, uint32_t engineInstance, uint32_t subDeviceId, ze_bool_t onSubdevice) {
Engine *pEngine = new EngineImp(pOsSysman, engineType, engineInstance, subDeviceId, onSubdevice);
std::unique_ptr<Engine> pEngine = std::make_unique<EngineImp>(pOsSysman, engineType, engineInstance, subDeviceId, onSubdevice);
if (pEngine->initSuccess == true) {
handleList.push_back(pEngine);
} else {
delete pEngine;
handleList.push_back(std::move(pEngine));
}
}
@@ -48,9 +46,6 @@ void EngineHandleContext::init(std::vector<ze_device_handle_t> &deviceHandles) {
}
void EngineHandleContext::releaseEngines() {
for (Engine *pEngine : handleList) {
delete pEngine;
}
handleList.clear();
}