Skip to content

Commit fa55904

Browse files
fix: return proper hw info config for dg2 platforms
Related-To: NEO-7622 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com> Source: c628ffe
1 parent c33c52a commit fa55904

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

shared/source/xe_hpg_core/definitions/compiler_product_helper_dg2.inl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
*
66
*/
77

8+
#include "shared/source/xe_hpg_core/hw_cmds_dg2.h"
9+
810
namespace NEO {
911
template <>
1012
uint64_t CompilerProductHelperHw<IGFX_DG2>::getHwInfoConfig(const HardwareInfo &hwInfo) const {
11-
return 0x0;
13+
if (DG2::isG10(hwInfo)) {
14+
return 0x800040010;
15+
}
16+
return 0x200040010;
1217
}
1318
} // namespace NEO

shared/test/unit_test/xe_hpg_core/dg2/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ if(TESTS_DG2)
1414
${CMAKE_CURRENT_SOURCE_DIR}/ail_tests_dg2.cpp
1515
${CMAKE_CURRENT_SOURCE_DIR}/cache_policy_tests_dg2.cpp
1616
${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests_dg2.cpp
17+
${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_dg2_tests.cpp
1718
${CMAKE_CURRENT_SOURCE_DIR}/device_binary_format_ar_tests_dg2.cpp
1819
${CMAKE_CURRENT_SOURCE_DIR}/gfx_core_helper_tests_dg2.cpp
1920
${CMAKE_CURRENT_SOURCE_DIR}/memory_manager_tests_dg2.cpp
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (C) 2023 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "shared/source/helpers/compiler_product_helper.h"
9+
#include "shared/source/xe_hpg_core/hw_cmds_dg2.h"
10+
#include "shared/test/common/mocks/mock_execution_environment.h"
11+
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
12+
#include "shared/test/common/test_macros/test.h"
13+
14+
using namespace NEO;
15+
16+
using CompilerProductHelperDg2Test = ::testing::Test;
17+
18+
DG2TEST_F(CompilerProductHelperDg2Test, givenDg2G10WhenGettingHwInfoConfigThenProperConfigIsReturned) {
19+
MockExecutionEnvironment executionEnvironment{};
20+
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
21+
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
22+
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
23+
24+
hwInfo.platform.usDeviceID = dg2G10DeviceIds[0];
25+
EXPECT_EQ(0x800040010u, compilerProductHelper.getHwInfoConfig(hwInfo));
26+
}
27+
28+
DG2TEST_F(CompilerProductHelperDg2Test, givenDg2NonG10WhenGettingHwInfoConfigThenProperConfigIsReturned) {
29+
MockExecutionEnvironment executionEnvironment{};
30+
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
31+
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
32+
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
33+
34+
hwInfo.platform.usDeviceID = dg2G11DeviceIds[0];
35+
EXPECT_EQ(0x200040010u, compilerProductHelper.getHwInfoConfig(hwInfo));
36+
37+
hwInfo.platform.usDeviceID = dg2G12DeviceIds[0];
38+
EXPECT_EQ(0x200040010u, compilerProductHelper.getHwInfoConfig(hwInfo));
39+
}

0 commit comments

Comments
 (0)