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

41 lines
951 B
C++

/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "level_zero/sysman/source/sysman_device_imp.h"
#include "shared/source/helpers/debug_helpers.h"
#include "level_zero/sysman/source/os_sysman.h"
#include <vector>
namespace L0 {
namespace Sysman {
SysmanDeviceImp::SysmanDeviceImp(NEO::ExecutionEnvironment *executionEnvironment, const uint32_t rootDeviceIndex)
: executionEnvironment(executionEnvironment), rootDeviceIndex(rootDeviceIndex) {
this->executionEnvironment->incRefInternal();
pOsSysman = OsSysman::create(this);
UNRECOVERABLE_IF(nullptr == pOsSysman);
}
SysmanDeviceImp::~SysmanDeviceImp() {
executionEnvironment->decRefInternal();
freeResource(pOsSysman);
}
ze_result_t SysmanDeviceImp::init() {
auto result = pOsSysman->init();
if (ZE_RESULT_SUCCESS != result) {
return result;
}
return result;
}
} // namespace Sysman
} // namespace L0