Skip to content

Commit 9df6808

Browse files
fix: add setup ARL hw ip version when not available from KMD
Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent d6560c5 commit 9df6808

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

shared/source/xe_hpg_core/enable_compiler_product_helper_arl.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,37 @@ constexpr auto gfxProduct = IGFX_ARROWLAKE;
1111

1212
#include "shared/source/xe_hpg_core/xe_lpg/compiler_product_helper_xe_lpg.inl"
1313

14+
namespace NEO {
15+
template <>
16+
uint32_t CompilerProductHelperHw<gfxProduct>::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const {
17+
if (hwInfo.ipVersion.value) {
18+
return hwInfo.ipVersion.value;
19+
}
20+
switch (hwInfo.platform.usDeviceID) {
21+
case 0x7D67: {
22+
switch (hwInfo.platform.usRevId) {
23+
case 0x0:
24+
return AOT::MTL_M_A0;
25+
case 0x3:
26+
case 0x6:
27+
return AOT::MTL_M_B0;
28+
}
29+
break;
30+
}
31+
case 0x7D51:
32+
case 0x7D41:
33+
case 0X7DD1: {
34+
switch (hwInfo.platform.usRevId) {
35+
case 0x0:
36+
case 0x3:
37+
return AOT::XE_LPGPLUS_A0;
38+
case 0x6:
39+
return AOT::XE_LPGPLUS_B0;
40+
}
41+
break;
42+
}
43+
}
44+
return getDefaultHwIpVersion();
45+
}
46+
} // namespace NEO
1447
static NEO::EnableCompilerProductHelper<gfxProduct> enableCompilerProductHelperARL;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ if(TESTS_ARL)
1212
${NEO_CORE_tests_xe_hpg_core_arl_excludes}
1313
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
1414
${CMAKE_CURRENT_SOURCE_DIR}/hw_aot_config_tests_arl.cpp
15+
${CMAKE_CURRENT_SOURCE_DIR}/product_helper_tests_arl.cpp
1516
)
1617

1718
add_subdirectories()
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright (C) 2022-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_arl.h"
10+
#include "shared/test/common/helpers/default_hw_info.h"
11+
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
12+
#include "shared/test/common/test_macros/test.h"
13+
#include "shared/test/unit_test/os_interface/product_helper_tests.h"
14+
15+
#include "platforms.h"
16+
17+
using namespace NEO;
18+
19+
using ArlProductHelper = ProductHelperTest;
20+
21+
ARLTEST_F(ArlProductHelper, givenArlWithoutHwIpVersionInHwInfoWhenGettingIpVersionThenCorrectValueIsReturnedBasedOnDeviceIdAndRevId) {
22+
auto hwInfo = *defaultHwInfo;
23+
hwInfo.ipVersion = {};
24+
25+
auto arlSDeviceIds = {0x7D67};
26+
auto arlHDeviceIds = {0x7D51, 0x7DD1, 0x7D41};
27+
28+
for (auto &deviceId : arlSDeviceIds) {
29+
hwInfo.platform.usDeviceID = deviceId;
30+
for (auto &revision : {0}) {
31+
hwInfo.platform.usRevId = revision;
32+
33+
EXPECT_EQ(AOT::MTL_M_A0, compilerProductHelper->getHwIpVersion(hwInfo));
34+
}
35+
for (auto &revision : {3, 6}) {
36+
hwInfo.platform.usRevId = revision;
37+
38+
EXPECT_EQ(AOT::MTL_M_B0, compilerProductHelper->getHwIpVersion(hwInfo));
39+
}
40+
hwInfo.platform.usRevId = 0xdead;
41+
42+
EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), compilerProductHelper->getHwIpVersion(hwInfo));
43+
}
44+
45+
for (auto &deviceId : arlHDeviceIds) {
46+
hwInfo.platform.usDeviceID = deviceId;
47+
for (auto &revision : {0, 3}) {
48+
hwInfo.platform.usRevId = revision;
49+
50+
EXPECT_EQ(AOT::XE_LPGPLUS_A0, compilerProductHelper->getHwIpVersion(hwInfo));
51+
}
52+
for (auto &revision : {6}) {
53+
hwInfo.platform.usRevId = revision;
54+
55+
EXPECT_EQ(AOT::XE_LPGPLUS_B0, compilerProductHelper->getHwIpVersion(hwInfo));
56+
}
57+
hwInfo.platform.usRevId = 0xdead;
58+
59+
EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), compilerProductHelper->getHwIpVersion(hwInfo));
60+
}
61+
62+
hwInfo.platform.usDeviceID = 0;
63+
hwInfo.platform.usRevId = 0xdead;
64+
65+
EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), compilerProductHelper->getHwIpVersion(hwInfo));
66+
}

0 commit comments

Comments
 (0)