mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
fix(sysman): Fix sysman APIs taking incorrect path
Related-To: NEO-12291 Signed-off-by: shubham kumar <shubham.kumar@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
32f80e1131
commit
739e781fd8
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "level_zero/core/source/device/device_imp.h"
|
||||
#include "level_zero/core/source/driver/driver.h"
|
||||
#include "level_zero/core/source/driver/driver_handle_imp.h"
|
||||
#include "level_zero/sysman/source/driver/sysman_driver.h"
|
||||
#include "level_zero/tools/source/sysman/os_sysman_driver.h"
|
||||
#include "level_zero/tools/source/sysman/sysman_imp.h"
|
||||
|
||||
@@ -34,6 +35,12 @@ void DeviceImp::createSysmanHandle(bool isSubDevice) {
|
||||
}
|
||||
|
||||
SysmanDevice *SysmanDeviceHandleContext::init(ze_device_handle_t coreDevice) {
|
||||
if (L0::Sysman::sysmanOnlyInit) {
|
||||
NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr,
|
||||
"%s", "Sysman Initialization already happened via zesInit\n");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SysmanDeviceImp *sysmanDevice = new SysmanDeviceImp(coreDevice);
|
||||
DEBUG_BREAK_IF(!sysmanDevice);
|
||||
if (ZE_RESULT_SUCCESS != sysmanDevice->init()) {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "shared/test/common/os_interface/linux/sys_calls_linux_ult.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "level_zero/sysman/source/driver/sysman_driver.h"
|
||||
#include "level_zero/tools/source/sysman/diagnostics/linux/os_diagnostics_imp.h"
|
||||
#include "level_zero/tools/source/sysman/events/linux/os_events_imp.h"
|
||||
#include "level_zero/tools/source/sysman/firmware/linux/os_firmware_imp.h"
|
||||
@@ -216,6 +217,16 @@ TEST_F(SysmanDeviceFixture, GivenValidDeviceHandleButSysmanInitFailsThenValidNul
|
||||
EXPECT_EQ(pSysmanDevice, nullptr);
|
||||
}
|
||||
|
||||
TEST_F(SysmanDeviceFixture, GivenValidDeviceHandleWithSysmanOnlyInitSetAsTrueThenSysmanInitFailsAndValidNullptrReceived) {
|
||||
ze_device_handle_t hSysman = device->toHandle();
|
||||
L0::Sysman::sysmanOnlyInit = true;
|
||||
L0::sysmanInitFromCore = false;
|
||||
auto pSysmanDevice = L0::SysmanDeviceHandleContext::init(hSysman);
|
||||
EXPECT_EQ(pSysmanDevice, nullptr);
|
||||
EXPECT_FALSE(L0::sysmanInitFromCore);
|
||||
L0::Sysman::sysmanOnlyInit = false;
|
||||
}
|
||||
|
||||
TEST_F(SysmanDeviceFixture, GivenSetValidDrmHandleForDeviceWhenDoingOsSysmanDeviceInitThenSameDrmHandleIsRetrieved) {
|
||||
EXPECT_EQ(&pLinuxSysmanImp->getDrm(), device->getOsInterface().getDriverModel()->as<Drm>());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user