Support for Diagnostics lazy init in zeInit flow
Modifications for Diagnostics module lazy init Related-To: LOCI-3127 Signed-off-by: Kulkarni, Ashwin Kumar <ashwin.kumar.kulkarni@intel.com>
This commit is contained in:
parent
49aaf62bbd
commit
abd2815ae7
|
@ -34,6 +34,9 @@ void DiagnosticsHandleContext::init() {
|
|||
}
|
||||
|
||||
ze_result_t DiagnosticsHandleContext::diagnosticsGet(uint32_t *pCount, zes_diag_handle_t *phDiagnostics) {
|
||||
std::call_once(initDiagnosticsOnce, [this]() {
|
||||
this->init();
|
||||
});
|
||||
uint32_t handleListSize = static_cast<uint32_t>(handleList.size());
|
||||
uint32_t numToCopy = std::min(*pCount, handleListSize);
|
||||
if (0 == *pCount || *pCount > handleListSize) {
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "level_zero/core/source/device/device.h"
|
||||
#include <level_zero/zes_api.h>
|
||||
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
@ -47,6 +48,7 @@ struct DiagnosticsHandleContext {
|
|||
|
||||
private:
|
||||
void createHandle(const std::string &diagTests);
|
||||
std::once_flag initDiagnosticsOnce;
|
||||
};
|
||||
|
||||
} // namespace L0
|
||||
|
|
|
@ -133,9 +133,6 @@ ze_result_t SysmanDeviceImp::init() {
|
|||
if (pFanHandleContext) {
|
||||
pFanHandleContext->init();
|
||||
}
|
||||
if (pDiagnosticsHandleContext) {
|
||||
pDiagnosticsHandleContext->init();
|
||||
}
|
||||
if (pPerformanceHandleContext) {
|
||||
pPerformanceHandleContext->init(deviceHandles, hCoreDevice);
|
||||
}
|
||||
|
|
|
@ -98,7 +98,6 @@ class ZesDiagnosticsFixture : public SysmanDeviceFixture {
|
|||
}
|
||||
pSysmanDeviceImp->pDiagnosticsHandleContext->handleList.clear();
|
||||
productFamily = pLinuxSysmanImp->getDeviceHandle()->getNEODevice()->getHardwareInfo().platform.eProductFamily;
|
||||
pSysmanDeviceImp->pDiagnosticsHandleContext->init();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
|
|
Loading…
Reference in New Issue