mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
fix: return proper hw info config for dg2 platforms
Related-To: NEO-7622 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
98006ce72a
commit
c628ffe18a
@@ -5,9 +5,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hpg_core/hw_cmds_dg2.h"
|
||||
|
||||
namespace NEO {
|
||||
template <>
|
||||
uint64_t CompilerProductHelperHw<IGFX_DG2>::getHwInfoConfig(const HardwareInfo &hwInfo) const {
|
||||
return 0x0;
|
||||
if (DG2::isG10(hwInfo)) {
|
||||
return 0x800040010;
|
||||
}
|
||||
return 0x200040010;
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
@@ -14,6 +14,7 @@ if(TESTS_DG2)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ail_tests_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cache_policy_tests_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_dg2_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_binary_format_ar_tests_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gfx_core_helper_tests_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/memory_manager_tests_dg2.cpp
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/compiler_product_helper.h"
|
||||
#include "shared/source/xe_hpg_core/hw_cmds_dg2.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using CompilerProductHelperDg2Test = ::testing::Test;
|
||||
|
||||
DG2TEST_F(CompilerProductHelperDg2Test, givenDg2G10WhenGettingHwInfoConfigThenProperConfigIsReturned) {
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
|
||||
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
|
||||
hwInfo.platform.usDeviceID = dg2G10DeviceIds[0];
|
||||
EXPECT_EQ(0x800040010u, compilerProductHelper.getHwInfoConfig(hwInfo));
|
||||
}
|
||||
|
||||
DG2TEST_F(CompilerProductHelperDg2Test, givenDg2NonG10WhenGettingHwInfoConfigThenProperConfigIsReturned) {
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0];
|
||||
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
|
||||
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
|
||||
hwInfo.platform.usDeviceID = dg2G11DeviceIds[0];
|
||||
EXPECT_EQ(0x200040010u, compilerProductHelper.getHwInfoConfig(hwInfo));
|
||||
|
||||
hwInfo.platform.usDeviceID = dg2G12DeviceIds[0];
|
||||
EXPECT_EQ(0x200040010u, compilerProductHelper.getHwInfoConfig(hwInfo));
|
||||
}
|
||||
Reference in New Issue
Block a user