Files
compute-runtime/level_zero/tools/source/sysman/ras/ras_imp.cpp
mraghuwa 220c575850 Update Ras Api's as per latest spec
Change-Id: I29b77eee0832fcca6d989f9ef41b01b17232a91e
Signed-off-by: mraghuwa <mayank.raghuwanshi@intel.com>
2020-08-06 08:31:03 +02:00

55 lines
1.2 KiB
C++

/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "level_zero/tools/source/sysman/ras/ras_imp.h"
#include "shared/source/helpers/debug_helpers.h"
#include "shared/source/helpers/string.h"
#include <cstring>
namespace L0 {
ze_result_t RasImp::rasGetProperties(zes_ras_properties_t *pProperties) {
rasProperties.type = this->rasErrorType;
rasProperties.onSubdevice = false;
rasProperties.subdeviceId = 0;
*pProperties = rasProperties;
return ZE_RESULT_SUCCESS;
}
ze_result_t RasImp::rasGetConfig(zes_ras_config_t *pConfig) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
ze_result_t RasImp::rasSetConfig(const zes_ras_config_t *pConfig) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
ze_result_t RasImp::rasGetState(const zes_ras_state_t *pState) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
void RasImp::init() {
pOsRas->setRasErrorType(this->rasErrorType);
isRasErrorSupported = pOsRas->isRasSupported();
}
RasImp::RasImp(OsSysman *pOsSysman, zes_ras_error_type_t type) {
pOsRas = OsRas::create(pOsSysman);
this->rasErrorType = type;
init();
}
RasImp::~RasImp() {
if (nullptr != pOsRas) {
delete pOsRas;
}
}
} // namespace L0