Skip to content

Commit 4b2b1ac

Browse files
Move TGLLP tests to dedicated directory
Change-Id: I62e0da2c984ae60a41e33cd061ec756fbd5704de Signed-off-by: Dunajski, Bartosz <[email protected]>
1 parent 115c166 commit 4b2b1ac

File tree

2 files changed

+49
-47
lines changed

2 files changed

+49
-47
lines changed

unit_tests/gen12lp/tgllp/test_hw_info_config_tgllp.cpp

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
/*
2-
* Copyright (C) 2019 Intel Corporation
2+
* Copyright (C) 2019-2020 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
66
*/
77

8+
#include "core/unit_tests/helpers/debug_manager_state_restore.h"
9+
#include "runtime/os_interface/device_factory.h"
810
#include "test.h"
11+
#include "unit_tests/mocks/mock_execution_environment.h"
912

1013
using namespace NEO;
1114

@@ -80,3 +83,48 @@ TGLLPTEST_F(TgllpHwInfo, givenHwInfoConfigStringThenAfterSetupResultingVmeIsDisa
8083
EXPECT_FALSE(hwInfo.capabilityTable.supportsVme);
8184
}
8285

86+
TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeForTgllpProductFamilyWhenGetDevicesForProductFamilyOverrideIsCalledThenAubCenterIsInitializedCorrectly) {
87+
DeviceFactoryCleaner cleaner;
88+
DebugManagerStateRestore stateRestore;
89+
DebugManager.flags.SetCommandStreamReceiver.set(1);
90+
DebugManager.flags.ProductFamilyOverride.set("tgllp");
91+
92+
MockExecutionEnvironment executionEnvironment(*platformDevices);
93+
94+
size_t numDevices = 0;
95+
bool success = DeviceFactory::getDevicesForProductFamilyOverride(numDevices, executionEnvironment);
96+
ASSERT_TRUE(success);
97+
98+
auto rootDeviceEnvironment = static_cast<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[0].get());
99+
100+
EXPECT_TRUE(rootDeviceEnvironment->initAubCenterCalled);
101+
EXPECT_FALSE(rootDeviceEnvironment->localMemoryEnabledReceived);
102+
}
103+
104+
TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeWhenGetDevicesForProductFamilyOverrideIsCalledThenAllRootDeviceEnvironmentMembersAreInitialized) {
105+
DeviceFactoryCleaner cleaner;
106+
DebugManagerStateRestore stateRestore;
107+
auto requiredDeviceCount = 2u;
108+
DebugManager.flags.CreateMultipleRootDevices.set(requiredDeviceCount);
109+
DebugManager.flags.SetCommandStreamReceiver.set(1);
110+
DebugManager.flags.ProductFamilyOverride.set("tgllp");
111+
112+
MockExecutionEnvironment executionEnvironment(*platformDevices, true, requiredDeviceCount);
113+
114+
size_t numDevices = 0;
115+
bool success = DeviceFactory::getDevicesForProductFamilyOverride(numDevices, executionEnvironment);
116+
ASSERT_TRUE(success);
117+
EXPECT_EQ(requiredDeviceCount, numDevices);
118+
119+
std::set<MemoryOperationsHandler *> memoryOperationHandlers;
120+
for (auto rootDeviceIndex = 0u; rootDeviceIndex < requiredDeviceCount; rootDeviceIndex++) {
121+
auto rootDeviceEnvironment = static_cast<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[rootDeviceIndex].get());
122+
EXPECT_TRUE(rootDeviceEnvironment->initAubCenterCalled);
123+
EXPECT_FALSE(rootDeviceEnvironment->localMemoryEnabledReceived);
124+
125+
auto memoryOperationInterface = rootDeviceEnvironment->memoryOperationsInterface.get();
126+
EXPECT_NE(nullptr, memoryOperationInterface);
127+
EXPECT_EQ(memoryOperationHandlers.end(), memoryOperationHandlers.find(memoryOperationInterface));
128+
memoryOperationHandlers.insert(memoryOperationInterface);
129+
}
130+
}

unit_tests/os_interface/device_factory_tests.cpp

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -167,52 +167,6 @@ TEST_F(DeviceFactoryTest, givenCreateMultipleRootDevicesDebugFlagWhenGetDevicesF
167167
EXPECT_EQ(requiredDeviceCount, numDevices);
168168
}
169169

170-
TEST_F(DeviceFactoryTest, givenSetCommandStreamReceiverInAubModeForTgllpProductFamilyWhenGetDevicesForProductFamilyOverrideIsCalledThenAubCenterIsInitializedCorrectly) {
171-
DeviceFactoryCleaner cleaner;
172-
DebugManagerStateRestore stateRestore;
173-
DebugManager.flags.SetCommandStreamReceiver.set(1);
174-
DebugManager.flags.ProductFamilyOverride.set("tgllp");
175-
176-
MockExecutionEnvironment executionEnvironment(*platformDevices);
177-
178-
size_t numDevices = 0;
179-
bool success = DeviceFactory::getDevicesForProductFamilyOverride(numDevices, executionEnvironment);
180-
ASSERT_TRUE(success);
181-
182-
auto rootDeviceEnvironment = static_cast<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[0].get());
183-
184-
EXPECT_TRUE(rootDeviceEnvironment->initAubCenterCalled);
185-
EXPECT_FALSE(rootDeviceEnvironment->localMemoryEnabledReceived);
186-
}
187-
188-
TEST_F(DeviceFactoryTest, givenSetCommandStreamReceiverInAubModeWhenGetDevicesForProductFamilyOverrideIsCalledThenAllRootDeviceEnvironmentMembersAreInitialized) {
189-
DeviceFactoryCleaner cleaner;
190-
DebugManagerStateRestore stateRestore;
191-
auto requiredDeviceCount = 2u;
192-
DebugManager.flags.CreateMultipleRootDevices.set(requiredDeviceCount);
193-
DebugManager.flags.SetCommandStreamReceiver.set(1);
194-
DebugManager.flags.ProductFamilyOverride.set("tgllp");
195-
196-
MockExecutionEnvironment executionEnvironment(*platformDevices, true, requiredDeviceCount);
197-
198-
size_t numDevices = 0;
199-
bool success = DeviceFactory::getDevicesForProductFamilyOverride(numDevices, executionEnvironment);
200-
ASSERT_TRUE(success);
201-
EXPECT_EQ(requiredDeviceCount, numDevices);
202-
203-
std::set<MemoryOperationsHandler *> memoryOperationHandlers;
204-
for (auto rootDeviceIndex = 0u; rootDeviceIndex < requiredDeviceCount; rootDeviceIndex++) {
205-
auto rootDeviceEnvironment = static_cast<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[rootDeviceIndex].get());
206-
EXPECT_TRUE(rootDeviceEnvironment->initAubCenterCalled);
207-
EXPECT_FALSE(rootDeviceEnvironment->localMemoryEnabledReceived);
208-
209-
auto memoryOperationInterface = rootDeviceEnvironment->memoryOperationsInterface.get();
210-
EXPECT_NE(nullptr, memoryOperationInterface);
211-
EXPECT_EQ(memoryOperationHandlers.end(), memoryOperationHandlers.find(memoryOperationInterface));
212-
memoryOperationHandlers.insert(memoryOperationInterface);
213-
}
214-
}
215-
216170
TEST_F(DeviceFactoryTest, whenGetDevicesIsCalledThenAllRootDeviceEnvironmentMembersAreInitialized) {
217171
DeviceFactoryCleaner cleaner;
218172
DebugManagerStateRestore stateRestore;

0 commit comments

Comments
 (0)