compute-runtime/level_zero/sysman/source/sysman_device.cpp

30 lines
732 B
C++

/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/execution_environment/execution_environment.h"
#include "level_zero/sysman/source/sysman_device_imp.h"
#include <cstring>
#include <vector>
namespace L0 {
namespace Sysman {
SysmanDevice *SysmanDevice::create(NEO::ExecutionEnvironment &executionEnvironment, const uint32_t rootDeviceIndex) {
SysmanDeviceImp *pSysmanDevice = new SysmanDeviceImp(&executionEnvironment, rootDeviceIndex);
DEBUG_BREAK_IF(!pSysmanDevice);
if (pSysmanDevice->init() != ZE_RESULT_SUCCESS) {
delete pSysmanDevice;
pSysmanDevice = nullptr;
}
return pSysmanDevice;
}
} // namespace Sysman
} // namespace L0