mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 09:58:55 +08:00
(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:
committed by
Compute-Runtime-Automation
parent
b161af5886
commit
49827b7122
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user