mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Move hw_info_config tests to shared
Signed-off-by: Daniel Chabrowski daniel.chabrowski@intel.com
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
16fd791a7c
commit
14134be74e
@ -8,7 +8,6 @@ set(IGDRCL_SRCS_tests_os_interface_base
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_factory_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_tests.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/os_context_tests.cpp
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/test/unit_test/os_interface/hw_info_config_tests.h"
|
||||
#include "shared/test/unit_test/os_interface/hw_info_config_tests.h"
|
||||
|
||||
#include "shared/source/helpers/driver_model_type.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
@ -25,17 +25,6 @@
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
void HwInfoConfigTest::SetUp() {
|
||||
pInHwInfo = *defaultHwInfo;
|
||||
|
||||
testPlatform = &pInHwInfo.platform;
|
||||
testSkuTable = &pInHwInfo.featureTable;
|
||||
testWaTable = &pInHwInfo.workaroundTable;
|
||||
testSysInfo = &pInHwInfo.gtSystemInfo;
|
||||
|
||||
outHwInfo = {};
|
||||
}
|
||||
|
||||
HWTEST_F(HwInfoConfigTest, givenDebugFlagSetWhenAskingForHostMemCapabilitesThenReturnCorrectValue) {
|
||||
DebugManagerStateRestore restore;
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct HwInfoConfigTest : public ::testing::Test {
|
||||
void SetUp() override;
|
||||
|
||||
HardwareInfo pInHwInfo;
|
||||
HardwareInfo outHwInfo;
|
||||
|
||||
PLATFORM *testPlatform = nullptr;
|
||||
FeatureTable *testSkuTable = nullptr;
|
||||
WorkaroundTable *testWaTable = nullptr;
|
||||
GT_SYSTEM_INFO *testSysInfo = nullptr;
|
||||
};
|
@ -13,7 +13,6 @@ set(IGDRCL_SRCS_tests_os_interface_linux
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/drm_memory_manager_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/file_logger_linux_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_linux_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_info_config_linux_tests.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/linux_create_command_queue_with_properties_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters_linux.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_performance_counters_linux.h
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/test/unit_test/os_interface/linux/hw_info_config_linux_tests.h"
|
||||
#include "shared/test/unit_test/os_interface/linux/hw_info_config_linux_tests.h"
|
||||
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
@ -47,47 +47,6 @@ struct DummyHwConfig : NEO::HwInfoConfigHw<IGFX_UNKNOWN> {
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
void mockCpuidex(int *cpuInfo, int functionId, int subfunctionId);
|
||||
|
||||
void HwInfoConfigTestLinux::SetUp() {
|
||||
HwInfoConfigTest::SetUp();
|
||||
executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
|
||||
|
||||
osInterface = new OSInterface();
|
||||
drm = new DrmMock(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
osInterface->setDriverModel(std::unique_ptr<DriverModel>(drm));
|
||||
|
||||
drm->storedDeviceID = pInHwInfo.platform.usDeviceID;
|
||||
drm->storedDeviceRevID = 0;
|
||||
drm->storedEUVal = pInHwInfo.gtSystemInfo.EUCount;
|
||||
drm->storedSSVal = pInHwInfo.gtSystemInfo.SubSliceCount;
|
||||
|
||||
rt_cpuidex_func = CpuInfo::cpuidexFunc;
|
||||
CpuInfo::cpuidexFunc = mockCpuidex;
|
||||
}
|
||||
|
||||
void HwInfoConfigTestLinux::TearDown() {
|
||||
CpuInfo::cpuidexFunc = rt_cpuidex_func;
|
||||
|
||||
delete osInterface;
|
||||
|
||||
HwInfoConfigTest::TearDown();
|
||||
}
|
||||
|
||||
void mockCpuidex(int *cpuInfo, int functionId, int subfunctionId) {
|
||||
if (subfunctionId == 0) {
|
||||
cpuInfo[0] = 0x7F;
|
||||
}
|
||||
if (subfunctionId == 1) {
|
||||
cpuInfo[0] = 0x1F;
|
||||
}
|
||||
if (subfunctionId == 2) {
|
||||
cpuInfo[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
struct HwInfoConfigTestLinuxDummy : HwInfoConfigTestLinux {
|
||||
void SetUp() override {
|
||||
HwInfoConfigTestLinux::SetUp();
|
||||
@ -517,4 +476,4 @@ HWTEST2_F(HwConfigLinux, givenSliceCountWhenConfigureHwInfoDrmThenProperInitiali
|
||||
for (uint32_t i = 0; i < sliceCount; i++) {
|
||||
EXPECT_TRUE(outHwInfo.gtSystemInfo.SliceInfo[i].Enabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/execution_environment/execution_environment.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/utilities/cpu_info.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/libult/linux/drm_mock.h"
|
||||
|
||||
#include "opencl/test/unit_test/os_interface/hw_info_config_tests.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct HwInfoConfigTestLinux : public HwInfoConfigTest {
|
||||
void SetUp() override;
|
||||
void TearDown() override;
|
||||
|
||||
OSInterface *osInterface;
|
||||
std::unique_ptr<ExecutionEnvironment> executionEnvironment;
|
||||
DrmMock *drm;
|
||||
|
||||
void (*rt_cpuidex_func)(int *, int, int);
|
||||
};
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@ -8,8 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
|
||||
#include "opencl/test/unit_test/os_interface/hw_info_config_tests.h"
|
||||
#include "shared/test/unit_test/os_interface/hw_info_config_tests.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
Reference in New Issue
Block a user