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