2020-04-06 15:26:25 +05:30
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2020 Intel Corporation
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "level_zero/tools/source/sysman/ras/ras_imp.h"
|
|
|
|
|
|
2020-06-15 16:33:11 +05:30
|
|
|
#include "shared/source/helpers/debug_helpers.h"
|
|
|
|
|
#include "shared/source/helpers/string.h"
|
|
|
|
|
|
|
|
|
|
#include <cstring>
|
|
|
|
|
|
2020-04-06 15:26:25 +05:30
|
|
|
namespace L0 {
|
|
|
|
|
|
2020-07-29 02:45:54 -07:00
|
|
|
ze_result_t RasImp::rasGetProperties(zes_ras_properties_t *pProperties) {
|
2020-06-15 16:33:11 +05:30
|
|
|
rasProperties.type = this->rasErrorType;
|
|
|
|
|
rasProperties.onSubdevice = false;
|
|
|
|
|
rasProperties.subdeviceId = 0;
|
|
|
|
|
*pProperties = rasProperties;
|
|
|
|
|
return ZE_RESULT_SUCCESS;
|
2020-04-06 15:26:25 +05:30
|
|
|
}
|
|
|
|
|
|
2020-07-29 02:45:54 -07:00
|
|
|
ze_result_t RasImp::rasGetConfig(zes_ras_config_t *pConfig) {
|
2020-04-06 15:26:25 +05:30
|
|
|
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-29 02:45:54 -07:00
|
|
|
ze_result_t RasImp::rasSetConfig(const zes_ras_config_t *pConfig) {
|
2020-04-06 15:26:25 +05:30
|
|
|
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-15 16:33:11 +05:30
|
|
|
void RasImp::init() {
|
|
|
|
|
pOsRas->setRasErrorType(this->rasErrorType);
|
|
|
|
|
isRasErrorSupported = pOsRas->isRasSupported();
|
2020-04-06 15:26:25 +05:30
|
|
|
}
|
|
|
|
|
|
2020-07-29 02:45:54 -07:00
|
|
|
RasImp::RasImp(OsSysman *pOsSysman, zes_ras_error_type_t type) {
|
2020-04-06 15:26:25 +05:30
|
|
|
pOsRas = OsRas::create(pOsSysman);
|
2020-06-15 16:33:11 +05:30
|
|
|
this->rasErrorType = type;
|
|
|
|
|
init();
|
2020-04-06 15:26:25 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RasImp::~RasImp() {
|
|
|
|
|
if (nullptr != pOsRas) {
|
|
|
|
|
delete pOsRas;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace L0
|