Add mechanism to avoid calling gdi calls while process exit

Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:
Kamil Diedrich
2022-05-17 15:23:15 +00:00
committed by Compute-Runtime-Automation
parent 673a6244ee
commit ddd8a08fac
49 changed files with 327 additions and 107 deletions

View File

@@ -145,6 +145,10 @@ ze_result_t DriverHandleImp::getExtensionProperties(uint32_t *pCount,
}
DriverHandleImp::~DriverHandleImp() {
if (memoryManager != nullptr) {
memoryManager->peekExecutionEnvironment().prepareForCleanup();
}
for (auto &device : this->devices) {
delete device;
}

View File

@@ -40,6 +40,9 @@ class CommandListFixture : public DeviceFixture {
}
void TearDown() {
event.reset(nullptr);
eventPool.reset(nullptr);
commandList.reset(nullptr);
DeviceFixture::TearDown();
}

View File

@@ -23,6 +23,7 @@ void DeviceFixture::SetUp() {
setupWithExecutionEnvironment(*executionEnvironment);
}
void DeviceFixture::setupWithExecutionEnvironment(NEO::ExecutionEnvironment &executionEnvironment) {
execEnv = &executionEnvironment;
neoDevice = NEO::MockDevice::createWithExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get(), &executionEnvironment, 0u);
mockBuiltIns = new MockBuiltins();
neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns);
@@ -37,10 +38,13 @@ void DeviceFixture::setupWithExecutionEnvironment(NEO::ExecutionEnvironment &exe
ze_result_t res = driverHandle->createContext(&desc, 0u, nullptr, &hContext);
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
context = static_cast<ContextImp *>(Context::fromHandle(hContext));
executionEnvironment.incRefInternal();
}
void DeviceFixture::TearDown() {
context->destroy();
driverHandle.reset(nullptr);
execEnv->decRefInternal();
}
void PageFaultDeviceFixture::SetUp() {

View File

@@ -100,6 +100,7 @@ struct DeviceFixture {
L0::Device *device = nullptr;
L0::ContextImp *context = nullptr;
MockBuiltins *mockBuiltIns = nullptr;
NEO::ExecutionEnvironment *execEnv = nullptr;
};
struct DriverHandleGetMemHandlePtrMock : public L0::DriverHandleImp {

View File

@@ -189,6 +189,7 @@ struct ModuleImmutableDataFixture : public DeviceFixture {
}
void TearDown() {
module.reset(nullptr);
DeviceFixture::TearDown();
}
@@ -238,6 +239,8 @@ struct ModuleFixture : public DeviceFixture {
}
void TearDown() {
kernel.reset(nullptr);
module.reset(nullptr);
DeviceFixture::TearDown();
}
@@ -287,6 +290,10 @@ struct MultiDeviceModuleFixture : public MultiDeviceFixture {
}
void TearDown() {
kernel.reset(nullptr);
for (auto &module : modules) {
module.reset(nullptr);
}
MultiDeviceFixture::TearDown();
}
@@ -375,6 +382,7 @@ struct ModuleWithZebinFixture : public DeviceFixture {
}
void TearDown() {
module.reset(nullptr);
DeviceFixture::TearDown();
}
std::unique_ptr<MockModuleWithZebin> module;

View File

@@ -36,6 +36,8 @@ struct TimestampEvent : public Test<DeviceFixture> {
}
void TearDown() override {
event.reset(nullptr);
eventPool.reset(nullptr);
DeviceFixture::TearDown();
}

View File

@@ -936,6 +936,11 @@ struct CmdlistAppendLaunchKernelWithImplicitArgsTests : CmdlistAppendLaunchKerne
expectedImplicitArgs.groupCountZ = 3;
}
void TearDown() override {
commandList.reset(nullptr);
CmdlistAppendLaunchKernelTests::TearDown();
}
template <typename FamilyType>
void dispatchKernelWithImplicitArgs() {
expectedImplicitArgs.globalSizeX = expectedImplicitArgs.localSizeX * expectedImplicitArgs.groupCountX;

View File

@@ -53,6 +53,9 @@ class CommandListMemoryExtensionFixture : public DeviceFixture {
void TearDown() {
context->freeMem(ptr);
event.reset(nullptr);
eventPool.reset(nullptr);
commandList.reset(nullptr);
DeviceFixture::TearDown();
}

View File

@@ -242,7 +242,6 @@ TEST_F(ContextGetStatusTest, givenCallToContextGetStatusThenCorrectErrorCodeIsRe
res = context->getStatus();
EXPECT_EQ(ZE_RESULT_ERROR_DEVICE_LOST, res);
context->destroy();
}

View File

@@ -286,6 +286,7 @@ TEST(Debugger, GivenLegacyDebuggerAndProgramDebuggingEnabledWhenInitializingDriv
::testing::internal::CaptureStderr();
auto executionEnvironment = new NEO::ExecutionEnvironment();
executionEnvironment->incRefInternal();
executionEnvironment->prepareRootDeviceEnvironments(1);
executionEnvironment->rootDeviceEnvironments[0]->debugger.reset(new MockSourceLevelDebugger());
@@ -306,6 +307,9 @@ TEST(Debugger, GivenLegacyDebuggerAndProgramDebuggingEnabledWhenInitializingDriv
std::string output = testing::internal::GetCapturedStderr();
EXPECT_EQ(std::string("Source Level Debugger cannot be used with Environment Variable enabling program debugging.\n"), output);
driverHandle.reset(nullptr);
executionEnvironment->decRefInternal();
}
} // namespace ult

View File

@@ -595,6 +595,8 @@ struct DeviceTest : public ::testing::Test {
NEO::MockCompilerEnableGuard mock(true);
DebugManager.flags.CreateMultipleRootDevices.set(numRootDevices);
neoDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get(), rootDeviceIndex);
execEnv = neoDevice->getExecutionEnvironment();
execEnv->incRefInternal();
NEO::DeviceVector devices;
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
@@ -602,8 +604,14 @@ struct DeviceTest : public ::testing::Test {
device = driverHandle->devices[0];
}
void TearDown() override {
driverHandle.reset(nullptr);
execEnv->decRefInternal();
}
DebugManagerStateRestore restorer;
std::unique_ptr<Mock<L0::DriverHandleImp>> driverHandle;
NEO::ExecutionEnvironment *execEnv;
NEO::Device *neoDevice = nullptr;
L0::Device *device = nullptr;
const uint32_t rootDeviceIndex = 1u;

View File

@@ -167,8 +167,6 @@ class MemoryManagerNTHandleMock : public NEO::OsAgnosticMemoryManager {
};
HWTEST_F(ImportNTHandle, givenNTHandleWhenCreatingDeviceMemoryThenSuccessIsReturned) {
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
ze_device_mem_alloc_desc_t devProperties = {};
devProperties.stype = ZE_STRUCTURE_TYPE_DEVICE_MEMORY_PROPERTIES;
@@ -179,32 +177,18 @@ HWTEST_F(ImportNTHandle, givenNTHandleWhenCreatingDeviceMemoryThenSuccessIsRetur
importNTHandle.stype = ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMPORT_WIN32;
devProperties.pNext = &importNTHandle;
NEO::MockDevice *neoDevice = nullptr;
auto executionEnvironment = NEO::MockDevice::prepareExecutionEnvironment(NEO::defaultHwInfo.get(), 0);
executionEnvironment->memoryManager.reset(new MemoryManagerNTHandleMock(*executionEnvironment));
neoDevice = NEO::MockDevice::createWithExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get(), executionEnvironment, 0);
driverHandle->setMemoryManager(executionEnvironment->memoryManager.get());
ze_result_t result = ZE_RESULT_SUCCESS;
auto device = L0::Device::create(driverHandle.get(), neoDevice, false, &result);
context->addDeviceAndSubDevices(device);
delete driverHandle->svmAllocsManager;
execEnv->memoryManager.reset(new MemoryManagerNTHandleMock(*execEnv));
driverHandle->setMemoryManager(execEnv->memoryManager.get());
driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false);
void *ptr;
result = context->allocDeviceMem(device, &devProperties, 100, 1, &ptr);
auto result = context->allocDeviceMem(device, &devProperties, 100, 1, &ptr);
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
auto alloc = driverHandle->getSvmAllocsManager()->getSVMAlloc(ptr);
ASSERT_EQ(alloc->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex())->peekSharedHandle(), NEO::toOsHandle(importNTHandle.handle));
result = context->freeMem(ptr);
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
delete device;
}
HWTEST_F(ImportNTHandle, whenCallingCreateGraphicsAllocationFromMultipleSharedHandlesFromOsAgnosticMemoryManagerThenNullptrIsReturned) {
@@ -220,16 +204,10 @@ HWTEST_F(ImportNTHandle, whenCallingCreateGraphicsAllocationFromMultipleSharedHa
importNTHandle.stype = ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMPORT_WIN32;
devProperties.pNext = &importNTHandle;
NEO::MockDevice *neoDevice = nullptr;
auto executionEnvironment = NEO::MockDevice::prepareExecutionEnvironment(NEO::defaultHwInfo.get(), 0);
executionEnvironment->memoryManager.reset(new MemoryManagerNTHandleMock(*executionEnvironment));
neoDevice = NEO::MockDevice::createWithExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get(), executionEnvironment, 0);
driverHandle->setMemoryManager(executionEnvironment->memoryManager.get());
ze_result_t result = ZE_RESULT_SUCCESS;
auto device = L0::Device::create(driverHandle.get(), neoDevice, false, &result);
delete driverHandle->svmAllocsManager;
execEnv->memoryManager.reset(new MemoryManagerNTHandleMock(*execEnv));
driverHandle->setMemoryManager(execEnv->memoryManager.get());
driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false);
std::vector<osHandle> handles{6, 7};
AllocationProperties properties = {device->getRootDeviceIndex(),
@@ -240,10 +218,8 @@ HWTEST_F(ImportNTHandle, whenCallingCreateGraphicsAllocationFromMultipleSharedHa
device->getNEODevice()->getDeviceBitfield()};
bool requireSpecificBitness{};
bool isHostIpcAllocation{};
auto ptr = executionEnvironment->memoryManager->createGraphicsAllocationFromMultipleSharedHandles(handles, properties, requireSpecificBitness, isHostIpcAllocation);
auto ptr = execEnv->memoryManager->createGraphicsAllocationFromMultipleSharedHandles(handles, properties, requireSpecificBitness, isHostIpcAllocation);
EXPECT_EQ(nullptr, ptr);
delete device;
}
HWTEST_F(ImportNTHandle, givenNotExistingNTHandleWhenCreatingDeviceMemoryThenErrorIsReturned) {

View File

@@ -712,6 +712,8 @@ class EventSynchronizeTest : public Test<DeviceFixture> {
}
void TearDown() override {
event.reset(nullptr);
eventPool.reset(nullptr);
DeviceFixture::TearDown();
}
@@ -1054,6 +1056,8 @@ class TimestampEventCreate : public Test<DeviceFixture> {
}
void TearDown() override {
event.reset(nullptr);
eventPool.reset(nullptr);
DeviceFixture::TearDown();
}
@@ -1187,6 +1191,8 @@ class TimestampDeviceEventCreate : public Test<DeviceFixture> {
}
void TearDown() override {
event.reset(nullptr);
eventPool.reset(nullptr);
DeviceFixture::TearDown();
}
@@ -1756,6 +1762,9 @@ struct EventSizeFixture : public DeviceFixture {
}
void TearDown() {
eventObj0.reset(nullptr);
eventObj1.reset(nullptr);
eventPool.reset(nullptr);
DeviceFixture::TearDown();
}

View File

@@ -386,14 +386,10 @@ HWTEST2_F(ImageCreate, givenNTHandleWhenCreatingImageThenSuccessIsReturned, IsAt
importNTHandle.stype = ZE_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMPORT_WIN32;
desc.pNext = &importNTHandle;
NEO::MockDevice *neoDevice = nullptr;
auto executionEnvironment = NEO::MockDevice::prepareExecutionEnvironment(NEO::defaultHwInfo.get(), 0);
executionEnvironment->memoryManager.reset(new MemoryManagerNTHandleMock(*executionEnvironment));
neoDevice = NEO::MockDevice::createWithExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get(), executionEnvironment, 0);
driverHandle->setMemoryManager(executionEnvironment->memoryManager.get());
ze_result_t result = ZE_RESULT_SUCCESS;
auto device = L0::Device::create(driverHandle.get(), neoDevice, false, &result);
delete driverHandle->svmAllocsManager;
execEnv->memoryManager.reset(new MemoryManagerNTHandleMock(*execEnv));
driverHandle->setMemoryManager(execEnv->memoryManager.get());
driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false);
auto imageHW = std::make_unique<WhiteBox<::L0::ImageCoreFamily<gfxCoreFamily>>>();
auto ret = imageHW->initialize(device, &desc);
@@ -401,7 +397,6 @@ HWTEST2_F(ImageCreate, givenNTHandleWhenCreatingImageThenSuccessIsReturned, IsAt
ASSERT_EQ(imageHW->getAllocation()->peekSharedHandle(), NEO::toOsHandle(importNTHandle.handle));
imageHW.reset(nullptr);
delete device;
}
class FailMemoryManagerMock : public NEO::OsAgnosticMemoryManager {
@@ -441,24 +436,17 @@ HWTEST2_F(ImageCreate, givenImageDescWhenFailImageAllocationThenProperErrorIsRet
backupSipInitType = true;
}
NEO::MockDevice *neoDevice = nullptr;
auto executionEnvironment = NEO::MockDevice::prepareExecutionEnvironment(NEO::defaultHwInfo.get(), 0);
auto failMemMngr = new FailMemoryManagerMock(*executionEnvironment);
executionEnvironment->memoryManager.reset(failMemMngr);
neoDevice = NEO::MockDevice::createWithExecutionEnvironment<NEO::MockDevice>(NEO::defaultHwInfo.get(), executionEnvironment, 0);
driverHandle->setMemoryManager(executionEnvironment->memoryManager.get());
ze_result_t result = ZE_RESULT_SUCCESS;
auto device = L0::Device::create(driverHandle.get(), neoDevice, false, &result);
delete driverHandle->svmAllocsManager;
execEnv->memoryManager.reset(new FailMemoryManagerMock(*execEnv));
driverHandle->setMemoryManager(execEnv->memoryManager.get());
driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false);
L0::Image *imageHandle = nullptr;
failMemMngr->fail = true;
static_cast<FailMemoryManagerMock *>(execEnv->memoryManager.get())->fail = true;
auto ret = L0::Image::create(neoDevice->getHardwareInfo().platform.eProductFamily, device, &desc, &imageHandle);
ASSERT_EQ(ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY, ret);
EXPECT_EQ(imageHandle, nullptr);
delete device;
}
HWTEST2_F(ImageCreate, givenMediaBlockOptionWhenCopySurfaceStateThenSurfaceStateIsSet, IsAtLeastSkl) {

View File

@@ -787,8 +787,6 @@ TEST_F(KernelImmutableDataTests, whenHasRTCallsIsTrueAndNoRTDispatchGlobalsIsAll
}
mockDescriptor.payloadMappings.implicitArgs.rtDispatchGlobals.pointerSize = 4;
NEO::MemoryManager *currMemoryManager = new NEO::FailMemoryManager(0, *neoDevice->executionEnvironment);
std::unique_ptr<MockImmutableData> mockKernelImmutableData =
std::make_unique<MockImmutableData>(32u);
mockKernelImmutableData->kernelDescriptor = &mockDescriptor;
@@ -812,7 +810,11 @@ TEST_F(KernelImmutableDataTests, whenHasRTCallsIsTrueAndNoRTDispatchGlobalsIsAll
immDataVector->push_back(std::move(mockKernelImmutableData));
neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->bindlessHeapsHelper.reset(nullptr);
neoDevice->injectMemoryManager(currMemoryManager);
delete driverHandle->svmAllocsManager;
execEnv->memoryManager.reset(new FailMemoryManager(0, *execEnv));
driverHandle->setMemoryManager(execEnv->memoryManager.get());
driverHandle->svmAllocsManager = new NEO::SVMAllocsManager(execEnv->memoryManager.get(), false);
EXPECT_EQ(ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY, kernel->initialize(&kernelDesc));
}

View File

@@ -1147,6 +1147,12 @@ struct ModuleDynamicLinkTests : public Test<ModuleFixture> {
module1 = std::make_unique<WhiteBox<::L0::Module>>(device, nullptr, ModuleType::User);
module2 = std::make_unique<WhiteBox<::L0::Module>>(device, nullptr, ModuleType::User);
}
void TearDown() override {
module0.reset(nullptr);
module1.reset(nullptr);
module2.reset(nullptr);
Test<ModuleFixture>::TearDown();
}
std::unique_ptr<WhiteBox<::L0::Module>> module0;
std::unique_ptr<WhiteBox<::L0::Module>> module1;
std::unique_ptr<WhiteBox<::L0::Module>> module2;

View File

@@ -55,8 +55,9 @@ class ZesDiagnosticsFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pMockFwInterface.reset(nullptr);
pLinuxSysmanImp->pFwUtilInterface = pFwUtilInterfaceOld;
SysmanDeviceFixture::TearDown();
}
void clearAndReinitHandles(std::vector<ze_device_handle_t> &deviceHandles) {

View File

@@ -76,12 +76,13 @@ class ZesEngineFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
device->getDriverHandle()->setMemoryManager(pMemoryManagerOriginal);
pLinuxSysmanImp->pDrm = pOriginalDrm;
pLinuxSysmanImp->pPmuInterface = pOriginalPmuInterface;
pLinuxSysmanImp->pSysfsAccess = pSysfsAccessOriginal;
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_engine_handle_t> getEngineHandles(uint32_t count) {

View File

@@ -52,9 +52,9 @@ class ZesFirmwareFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pFwUtilInterface = pFwUtilInterfaceOld;
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_firmware_handle_t> getFirmwareHandles(uint32_t count) {

View File

@@ -85,8 +85,8 @@ class SysmanDeviceFrequencyFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pSysfsAccess = pSysfsAccessOld;
SysmanDeviceFixture::TearDown();
}
double clockValue(const double calculatedClock) {

View File

@@ -148,10 +148,11 @@ class SysmanGlobalOperationsFixture : public SysmanDeviceFixture {
pSysmanDeviceImp->pDiagnosticsHandleContext = pDiagnosticsHandleContextOld;
pSysmanDeviceImp->pFirmwareHandleContext = pFirmwareHandleContextOld;
pSysmanDeviceImp->pRasHandleContext = pRasHandleContextOld;
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pSysfsAccess = pSysfsAccessOld;
pLinuxSysmanImp->pProcfsAccess = pProcfsAccessOld;
pLinuxSysmanImp->pFsAccess = pFsAccessOld;
SysmanDeviceFixture::TearDown();
}
};
class SysmanGlobalOperationsIntegratedFixture : public SysmanGlobalOperationsFixture {
@@ -237,7 +238,7 @@ TEST_F(SysmanGlobalOperationsFixture, GivenValidDeviceHandleWhenCallingzesDevice
TEST_F(SysmanGlobalOperationsFixture, GivenValidDeviceHandleWhenCallingzesDeviceGetPropertiesForCheckingDevicePropertiesWhenVendorIsUnKnownThenVerifyzesDeviceGetPropertiesCallSucceeds) {
ON_CALL(*pSysfsAccess.get(), read(_, Matcher<std::string &>(_)))
.WillByDefault(::testing::Invoke(pSysfsAccess.get(), &Mock<GlobalOperationsSysfsAccess>::getFalseValString));
neoDevice->deviceInfo.vendorId = 1806; //Unknown Vendor id
neoDevice->deviceInfo.vendorId = 1806; // Unknown Vendor id
pGlobalOperationsImp->init();
zes_device_properties_t properties;
ze_result_t result = zesDeviceGetProperties(device, &properties);

View File

@@ -85,6 +85,7 @@ class SysmanDeviceFixture : public DeviceFixture, public ::testing::Test {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
DeviceFixture::TearDown();
unsetenv("ZES_ENABLE_SYSMAN");
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -45,9 +45,9 @@ struct SysmanPmuFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pPmuInterface = pOriginalPmuInterface;
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
SysmanDeviceFixture::TearDown();
}
};

View File

@@ -54,11 +54,11 @@ class SysmanDeviceMemoryFixture : public SysmanDeviceFixture {
GTEST_SKIP();
}
device->getDriverHandle()->setMemoryManager(pMemoryManagerOld);
SysmanDeviceFixture::TearDown();
if (pMemoryManager != nullptr) {
delete pMemoryManager;
pMemoryManager = nullptr;
}
SysmanDeviceFixture::TearDown();
}
void setLocalSupportedAndReinit(bool supported) {

View File

@@ -66,7 +66,6 @@ class SysmanDeviceMemoryFixture : public SysmanDeviceFixture {
GTEST_SKIP();
}
device->getDriverHandle()->setMemoryManager(pMemoryManagerOld);
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pDrm = pOriginalDrm;
if (pDrm != nullptr) {
delete pDrm;
@@ -76,6 +75,7 @@ class SysmanDeviceMemoryFixture : public SysmanDeviceFixture {
delete pMemoryManager;
pMemoryManager = nullptr;
}
SysmanDeviceFixture::TearDown();
}
void setLocalSupportedAndReinit(bool supported) {

View File

@@ -198,7 +198,6 @@ class ZesPciFixture : public SysmanDeviceFixture {
GTEST_SKIP();
}
device->getDriverHandle()->setMemoryManager(pMemoryManagerOld);
SysmanDeviceFixture::TearDown();
if (nullptr != pPciImp->pOsPci) {
delete pPciImp->pOsPci;
}
@@ -211,6 +210,7 @@ class ZesPciFixture : public SysmanDeviceFixture {
delete memoryManager;
memoryManager = nullptr;
}
SysmanDeviceFixture::TearDown();
}
};

View File

@@ -396,9 +396,9 @@ class SysmanDevicePowerFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
pLinuxSysmanImp->pSysfsAccess = pSysfsAccessOld;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_pwr_handle_t> getPowerHandles(uint32_t count) {
@@ -474,10 +474,10 @@ class SysmanDevicePowerMultiDeviceFixture : public SysmanMultiDeviceFixture {
for (const auto &pmtMapElement : pLinuxSysmanImp->mapOfSubDeviceIdToPmtObject) {
delete pmtMapElement.second;
}
SysmanMultiDeviceFixture::TearDown();
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
pLinuxSysmanImp->pSysfsAccess = pSysfsAccessOld;
pLinuxSysmanImp->mapOfSubDeviceIdToPmtObject = mapOriginal;
SysmanMultiDeviceFixture::TearDown();
}
std::vector<zes_pwr_handle_t> getPowerHandles(uint32_t count) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -58,8 +58,8 @@ class SysmanDevicePowerFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pWddmSysmanImp->pKmdSysManager = pOriginalKmdSysManager;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_pwr_handle_t> get_power_handles(uint32_t count) {

View File

@@ -49,8 +49,8 @@ struct SysmanRasFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_ras_handle_t> getRasHandles(uint32_t count) {

View File

@@ -92,8 +92,8 @@ class SysmanDeviceSchedulerFixture : public SysmanDeviceFixture {
GTEST_SKIP();
}
pSysfsAccess->cleanUpMap();
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pSysfsAccess = pSysfsAccessOld;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_sched_handle_t> getSchedHandles(uint32_t count) {

View File

@@ -124,8 +124,8 @@ class SysmanMultiDeviceTemperatureFixture : public SysmanMultiDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanMultiDeviceFixture::TearDown();
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
SysmanMultiDeviceFixture::TearDown();
}
std::vector<zes_temp_handle_t> getTempHandles(uint32_t count) {
@@ -244,8 +244,8 @@ class SysmanDeviceTemperatureFixture : public SysmanDeviceFixture {
if (!sysmanUltsEnable) {
GTEST_SKIP();
}
SysmanDeviceFixture::TearDown();
pLinuxSysmanImp->pFsAccess = pFsAccessOriginal;
SysmanDeviceFixture::TearDown();
}
std::vector<zes_temp_handle_t> getTempHandles(uint32_t count) {