Implement RAS APIs

- Implement zetSysmanRasGet API

Change-Id: Ic2a82ceac2619cd1955d4e39924228f94ecd42dd
This commit is contained in:
Vilvaraj, T J Vivek
2020-04-22 10:00:08 +05:30
committed by sys_ocldev
parent 5374a0ffc1
commit 749e59fc54

View File

@@ -21,7 +21,18 @@ void RasHandleContext::init() {
}
ze_result_t RasHandleContext::rasGet(uint32_t *pCount, zet_sysman_ras_handle_t *phRas) {
*pCount = 0;
if (nullptr == phRas) {
*pCount = static_cast<uint32_t>(handleList.size());
return ZE_RESULT_SUCCESS;
}
uint32_t i = 0;
for (Ras *ras : handleList) {
if (i >= *pCount) {
break;
}
phRas[i++] = ras->toHandle();
}
*pCount = i;
return ZE_RESULT_SUCCESS;
}