|
| 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