Skip to content

Commit 62d52ba

Browse files
Fix DG1 tests fail
Related-To: NEO-5679 Signed-off-by: Konstanty Misiak <[email protected]>
1 parent 2b12e9b commit 62d52ba

File tree

10 files changed

+24
-126
lines changed

10 files changed

+24
-126
lines changed

level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,7 @@ HWTEST2_F(DeviceQueueGroupTest,
129129
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
130130
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS);
131131
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS);
132-
auto hwInfoConfig = NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
133-
if (hwInfoConfig->isEvenContextCountRequired()) {
134-
EXPECT_EQ(properties[i].numQueues, 2u);
135-
} else {
136-
EXPECT_EQ(properties[i].numQueues, 1u);
137-
}
132+
EXPECT_EQ(properties[i].numQueues, 1u);
138133
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
139134
} else if (i == static_cast<uint32_t>(NEO::EngineGroupType::Compute)) {
140135
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE);
@@ -178,12 +173,7 @@ HWTEST2_F(DeviceQueueGroupTest,
178173
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
179174
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS);
180175
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS);
181-
auto hwInfoConfig = NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
182-
if (hwInfoConfig->isEvenContextCountRequired()) {
183-
EXPECT_EQ(properties[i].numQueues, 2u);
184-
} else {
185-
EXPECT_EQ(properties[i].numQueues, 1u);
186-
}
176+
EXPECT_EQ(properties[i].numQueues, 1u);
187177
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
188178
} else if (i == static_cast<uint32_t>(NEO::EngineGroupType::Compute)) {
189179
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE);

opencl/test/unit_test/gen12lp/dg1/windows/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

opencl/test/unit_test/gen12lp/dg1/windows/hw_info_config_tests_dg1.cpp

Lines changed: 0 additions & 21 deletions
This file was deleted.

opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl

Lines changed: 22 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,32 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetAndBcsInfoSetWhenGetGpgp
135135
EXPECT_EQ(aub_stream::ENGINE_BCS, engines[3].first);
136136
}
137137

138+
GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetAndCcsDefualtEngineWhenGetGpgpuEnginesThenReturnTwoRcsEnginesAndOneCcs) {
139+
HardwareInfo hwInfo = *defaultHwInfo;
140+
hwInfo.featureTable.ftrCCSNode = false;
141+
hwInfo.featureTable.ftrBcsInfo = 0;
142+
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
143+
144+
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
145+
EXPECT_EQ(3u, device->engines.size());
146+
auto &engines = HwHelperHw<FamilyType>::get().getGpgpuEngineInstances(hwInfo);
147+
EXPECT_EQ(3u, engines.size());
148+
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[0].first);
149+
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[1].first);
150+
EXPECT_EQ(aub_stream::ENGINE_CCS, engines[2].first);
151+
}
152+
138153
GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetWhenGetGpgpuEnginesThenReturnThreeRcsEngines) {
139154
HardwareInfo hwInfo = *defaultHwInfo;
140155
hwInfo.featureTable.ftrCCSNode = false;
141156
hwInfo.featureTable.ftrBcsInfo = 0;
142157
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
143-
const auto expectedEnginesCount = HwInfoConfig::get(hwInfo.platform.eProductFamily)->isEvenContextCountRequired() ? 4u : 3u;
144158

145159
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
146-
EXPECT_EQ(expectedEnginesCount, device->engines.size());
160+
EXPECT_EQ(3u, device->engines.size());
147161
auto &engines = HwHelperHw<FamilyType>::get().getGpgpuEngineInstances(hwInfo);
148162

149-
EXPECT_EQ(expectedEnginesCount, engines.size());
163+
EXPECT_EQ(3u, engines.size());
150164
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[0].first);
151165
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[1].first);
152166
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[2].first);
@@ -162,46 +176,6 @@ GEN12LPTEST_F(HwHelperTestGen12Lp,
162176
EXPECT_EQ(internalCopyEngine, nullptr);
163177
}
164178

165-
GEN12LPTEST_F(HwHelperTestGen12Lp, givenEvenContextCountRequiredWhenGetGpgpuEnginesIsCalledThenInsertAdditionalEngineAtTheEndIfNeeded) {
166-
struct MockHwInfoConfig : HwInfoConfigHw<IGFX_UNKNOWN> {
167-
MockHwInfoConfig() {}
168-
bool evenContextCountRequired = false;
169-
bool isEvenContextCountRequired() override {
170-
return evenContextCountRequired;
171-
}
172-
};
173-
174-
HardwareInfo hwInfo = *defaultHwInfo;
175-
hwInfo.featureTable.ftrCCSNode = false;
176-
hwInfo.featureTable.ftrBcsInfo = 0;
177-
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
178-
179-
MockHwInfoConfig hwInfoConfig;
180-
VariableBackup<HwInfoConfig *> hwInfoConfigBackup{&hwInfoConfigFactory[hwInfo.platform.eProductFamily], &hwInfoConfig};
181-
182-
hwInfoConfig.evenContextCountRequired = false;
183-
auto engines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo);
184-
EXPECT_EQ(3u, engines.size());
185-
186-
hwInfoConfig.evenContextCountRequired = true;
187-
engines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo);
188-
EXPECT_EQ(4u, engines.size());
189-
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[engines.size() - 1].first);
190-
191-
hwInfo.featureTable.ftrCCSNode = true;
192-
engines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo);
193-
EXPECT_EQ(4u, engines.size());
194-
195-
hwInfo.featureTable.ftrCCSNode = true;
196-
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
197-
engines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo);
198-
EXPECT_EQ(4u, engines.size());
199-
200-
hwInfo.featureTable.ftrCCSNode = false;
201-
engines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo);
202-
EXPECT_EQ(4u, engines.size());
203-
}
204-
205179
GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetWhenGetGpgpuEnginesThenReturnTwoRcsAndCcsEngines) {
206180
HardwareInfo hwInfo = *defaultHwInfo;
207181
hwInfo.featureTable.ftrCCSNode = true;
@@ -220,16 +194,15 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetWhenGetGpgpuEnginesThenRetu
220194

221195
GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetFtrGpGpuMidThreadLevelPreemptSetWhenGetGpgpuEnginesThenReturn2RcsAndCcsEngines) {
222196
HardwareInfo hwInfo = *defaultHwInfo;
223-
auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
224197
hwInfo.featureTable.ftrCCSNode = true;
225198
hwInfo.featureTable.ftrBcsInfo = 0;
226199
hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = true;
227200
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_CCS;
228-
size_t retDeivices = 3u + hwInfoConfig->isEvenContextCountRequired();
201+
229202
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
230-
EXPECT_EQ(retDeivices, device->engines.size());
203+
EXPECT_EQ(3u, device->engines.size());
231204
auto &engines = HwHelperHw<FamilyType>::get().getGpgpuEngineInstances(hwInfo);
232-
EXPECT_EQ(retDeivices, engines.size());
205+
EXPECT_EQ(3u, engines.size());
233206
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[0].first);
234207
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[1].first);
235208
EXPECT_EQ(aub_stream::ENGINE_CCS, engines[2].first);
@@ -258,17 +231,13 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeSetAndDefaultRcsWhenGetGpgpuEn
258231
hwInfo.featureTable.ftrBcsInfo = 0;
259232
hwInfo.capabilityTable.defaultEngineType = aub_stream::ENGINE_RCS;
260233

261-
const auto expectedEnginesCount = HwInfoConfig::get(hwInfo.platform.eProductFamily)->isEvenContextCountRequired() ? 4u : 3u;
262234
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0));
263-
EXPECT_EQ(expectedEnginesCount, device->engines.size());
235+
EXPECT_EQ(3u, device->engines.size());
264236
auto &engines = HwHelperHw<FamilyType>::get().getGpgpuEngineInstances(hwInfo);
265-
EXPECT_EQ(expectedEnginesCount, engines.size());
237+
EXPECT_EQ(3u, engines.size());
266238
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[0].first);
267239
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[1].first);
268240
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[2].first);
269-
if (expectedEnginesCount == 4) {
270-
EXPECT_EQ(aub_stream::ENGINE_RCS, engines[3].first);
271-
}
272241
}
273242

274243
GEN12LPTEST_F(HwHelperTestGen12Lp, givenTgllpWhenIsFusedEuDispatchEnabledIsCalledThenResultIsCorrect) {

opencl/test/unit_test/os_interface/linux/hw_info_config_linux_tests.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ cl_unified_shared_memory_capabilities_intel HwInfoConfigHw<IGFX_UNKNOWN>::getSha
8383
return 0;
8484
}
8585

86-
template <>
87-
bool HwInfoConfigHw<IGFX_UNKNOWN>::isEvenContextCountRequired() {
88-
return false;
89-
}
90-
9186
template <>
9287
void HwInfoConfigHw<IGFX_UNKNOWN>::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo){};
9388

opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ template <>
6161
void HwInfoConfigHw<IGFX_UNKNOWN>::adjustPlatformForProductFamily(HardwareInfo *hwInfo) {
6262
}
6363

64-
template <>
65-
bool HwInfoConfigHw<IGFX_UNKNOWN>::isEvenContextCountRequired() {
66-
return false;
67-
}
68-
6964
template <>
7065
void HwInfoConfigHw<IGFX_UNKNOWN>::convertTimestampsFromOaToCsDomain(uint64_t &timestampData){};
7166

shared/source/gen12lp/hw_helper_gen12lp.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,6 @@ const HwHelper::EngineInstancesContainer HwHelperHw<Family>::getGpgpuEngineInsta
196196
engines.push_back({aub_stream::ENGINE_BCS, EngineUsage::Regular});
197197
}
198198

199-
auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily);
200-
if (hwInfoConfig->isEvenContextCountRequired() && engines.size() & 1) {
201-
engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::Regular});
202-
}
203-
204199
return engines;
205200
};
206201

shared/source/gen12lp/windows/hw_info_config_gen12lp.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ void HwInfoConfigHw<IGFX_DG1>::adjustPlatformForProductFamily(HardwareInfo *hwIn
3535
Gen12LPCommonFunctions::adjustPlatformForProductFamily(hwInfo->platform, GFXCORE_FAMILY::IGFX_GEN12LP_CORE);
3636
}
3737

38-
template <>
39-
bool HwInfoConfigHw<IGFX_DG1>::isEvenContextCountRequired() {
40-
return true;
41-
}
42-
4338
template class HwInfoConfigHw<IGFX_DG1>;
4439
#endif
4540
#ifdef SUPPORT_RKL

shared/source/os_interface/hw_info_config.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class HwInfoConfig {
3535
virtual uint64_t getCrossDeviceSharedMemCapabilities() = 0;
3636
virtual void getKernelExtendedProperties(uint32_t *fp16, uint32_t *fp32, uint32_t *fp64) = 0;
3737
virtual uint64_t getSharedSystemMemCapabilities() = 0;
38-
virtual bool isEvenContextCountRequired() = 0;
3938
virtual void convertTimestampsFromOaToCsDomain(uint64_t &timestampData) = 0;
4039
virtual uint32_t getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) = 0;
4140
uint32_t threadsPerEu;
@@ -57,7 +56,6 @@ class HwInfoConfigHw : public HwInfoConfig {
5756
uint64_t getCrossDeviceSharedMemCapabilities() override;
5857
void getKernelExtendedProperties(uint32_t *fp16, uint32_t *fp32, uint32_t *fp64) override;
5958
uint64_t getSharedSystemMemCapabilities() override;
60-
bool isEvenContextCountRequired() override;
6159
void convertTimestampsFromOaToCsDomain(uint64_t &timestampData) override;
6260
uint32_t getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) override;
6361

shared/source/os_interface/hw_info_config.inl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ uint64_t HwInfoConfigHw<gfxProduct>::getSharedSystemMemCapabilities() {
3131
return 0;
3232
}
3333

34-
template <PRODUCT_FAMILY gfxProduct>
35-
bool HwInfoConfigHw<gfxProduct>::isEvenContextCountRequired() {
36-
return false;
37-
}
38-
3934
template <PRODUCT_FAMILY gfxProduct>
4035
void HwInfoConfigHw<gfxProduct>::convertTimestampsFromOaToCsDomain(uint64_t &timestampData){};
4136

0 commit comments

Comments
 (0)