Implement clear option for zesRasGetState

Signed-off-by: Mayank Raghuwanshi <mayank.raghuwanshi@intel.com>
This commit is contained in:
Mayank Raghuwanshi
2021-01-07 15:58:00 +05:30
committed by Compute-Runtime-Automation
parent 494a59c7df
commit 5cd5705239
9 changed files with 30 additions and 18 deletions

View File

@@ -648,7 +648,7 @@ zesRasGetState(
zes_ras_handle_t hRas,
ze_bool_t clear,
zes_ras_state_t *pState) {
return L0::Ras::fromHandle(hRas)->rasGetState(pState);
return L0::Ras::fromHandle(hRas)->rasGetState(pState, clear);
}
ZE_APIEXPORT ze_result_t ZE_APICALL

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -15,7 +15,7 @@ ze_result_t OsRas::getSupportedRasErrorTypes(std::vector<zes_ras_error_type_t> &
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
ze_result_t LinuxRasImp::osRasGetState(zes_ras_state_t &state) {
ze_result_t LinuxRasImp::osRasGetState(zes_ras_state_t &state, ze_bool_t clear) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -15,7 +15,7 @@ namespace L0 {
class LinuxRasImp : public OsRas, NEO::NonCopyableOrMovableClass {
public:
ze_result_t osRasGetProperties(zes_ras_properties_t &properties) override;
ze_result_t osRasGetState(zes_ras_state_t &state) override;
ze_result_t osRasGetState(zes_ras_state_t &state, ze_bool_t clear) override;
LinuxRasImp(OsSysman *pOsSysman, zes_ras_error_type_t type, ze_bool_t onSubdevice, uint32_t subdeviceId);
LinuxRasImp() = default;
~LinuxRasImp() override = default;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -17,7 +17,7 @@ struct OsSysman;
class OsRas {
public:
virtual ze_result_t osRasGetProperties(zes_ras_properties_t &properties) = 0;
virtual ze_result_t osRasGetState(zes_ras_state_t &state) = 0;
virtual ze_result_t osRasGetState(zes_ras_state_t &state, ze_bool_t clear) = 0;
static OsRas *create(OsSysman *pOsSysman, zes_ras_error_type_t type, ze_bool_t onSubdevice, uint32_t subdeviceId);
static ze_result_t getSupportedRasErrorTypes(std::vector<zes_ras_error_type_t> &errorType, OsSysman *pOsSysman, ze_device_handle_t deviceHandle);
virtual ~OsRas() = default;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -24,7 +24,7 @@ class Ras : _zes_ras_handle_t {
virtual ze_result_t rasGetProperties(zes_ras_properties_t *pProperties) = 0;
virtual ze_result_t rasGetConfig(zes_ras_config_t *pConfig) = 0;
virtual ze_result_t rasSetConfig(const zes_ras_config_t *pConfig) = 0;
virtual ze_result_t rasGetState(zes_ras_state_t *pState) = 0;
virtual ze_result_t rasGetState(zes_ras_state_t *pState, ze_bool_t clear) = 0;
static Ras *fromHandle(zes_ras_handle_t handle) {
return static_cast<Ras *>(handle);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -27,8 +27,9 @@ ze_result_t RasImp::rasSetConfig(const zes_ras_config_t *pConfig) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
ze_result_t RasImp::rasGetState(zes_ras_state_t *pState) {
return pOsRas->osRasGetState(*pState);
ze_result_t RasImp::rasGetState(zes_ras_state_t *pState, ze_bool_t clear) {
memset(pState->category, 0, sizeof(pState->category));
return pOsRas->osRasGetState(*pState, clear);
}
void RasImp::init() {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -19,7 +19,7 @@ class RasImp : public Ras, NEO::NonCopyableOrMovableClass {
ze_result_t rasGetProperties(zes_ras_properties_t *pProperties) override;
ze_result_t rasGetConfig(zes_ras_config_t *pConfig) override;
ze_result_t rasSetConfig(const zes_ras_config_t *pConfig) override;
ze_result_t rasGetState(zes_ras_state_t *pConfig) override;
ze_result_t rasGetState(zes_ras_state_t *pConfig, ze_bool_t clear) override;
RasImp() = default;
RasImp(OsSysman *pOsSysman, zes_ras_error_type_t type, ze_device_handle_t deviceHandle);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -11,7 +11,7 @@ namespace L0 {
class WddmRasImp : public OsRas {
ze_result_t osRasGetProperties(zes_ras_properties_t &properties) override;
ze_result_t osRasGetState(zes_ras_state_t &state) override;
ze_result_t osRasGetState(zes_ras_state_t &state, ze_bool_t clear) override;
};
ze_result_t OsRas::getSupportedRasErrorTypes(std::vector<zes_ras_error_type_t> &errorType, OsSysman *pOsSysman, ze_device_handle_t deviceHandle) {
@@ -22,7 +22,7 @@ ze_result_t WddmRasImp::osRasGetProperties(zes_ras_properties_t &properties) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
ze_result_t WddmRasImp::osRasGetState(zes_ras_state_t &state) {
ze_result_t WddmRasImp::osRasGetState(zes_ras_state_t &state, ze_bool_t clear) {
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 Intel Corporation
* Copyright (C) 2020-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -360,8 +360,19 @@ void testSysmanRas(ze_device_handle_t &device) {
if (rasProperties.type == ZES_RAS_ERROR_TYPE_UNCORRECTABLE) {
std::cout << "Number of fatal accelerator engine resets attempted by the driver = " << rasState.category[ZES_RAS_ERROR_CAT_RESET] << std::endl;
std::cout << "Number of fatal errors that have occurred in caches = " << rasState.category[ZES_RAS_ERROR_CAT_CACHE_ERRORS] << std::endl;
std::cout << "Number of fatal programming errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_PROGRAMMING_ERRORS] << std::endl;
std::cout << "Number of fatal driver errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_DRIVER_ERRORS] << std::endl;
std::cout << "Number of fatal compute errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_COMPUTE_ERRORS] << std::endl;
std::cout << "Number of fatal non compute errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_NON_COMPUTE_ERRORS] << std::endl;
std::cout << "Number of fatal display errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_DISPLAY_ERRORS] << std::endl;
} else {
std::cout << "Number of correctable accelerator engine resets attempted by the driver = " << rasState.category[ZES_RAS_ERROR_CAT_RESET] << std::endl;
std::cout << "Number of correctable errors that have occurred in caches = " << rasState.category[ZES_RAS_ERROR_CAT_CACHE_ERRORS] << std::endl;
std::cout << "Number of correctable programming errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_PROGRAMMING_ERRORS] << std::endl;
std::cout << "Number of correctable driver errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_DRIVER_ERRORS] << std::endl;
std::cout << "Number of correctable compute errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_COMPUTE_ERRORS] << std::endl;
std::cout << "Number of correctable non compute errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_NON_COMPUTE_ERRORS] << std::endl;
std::cout << "Number of correctable display errors that have occurred = " << rasState.category[ZES_RAS_ERROR_CAT_DISPLAY_ERRORS] << std::endl;
}
}
}