Move isPageTableManagerSupported function from HwHelper to HwInfoConfig

Signed-off-by: Rafal Maziejuk <rafal.maziejuk@intel.com>
Related-To: NEO-4541
This commit is contained in:
Rafal Maziejuk
2021-08-19 11:06:49 +00:00
committed by Compute-Runtime-Automation
parent 78fa40fac0
commit c6ee7065db
34 changed files with 204 additions and 89 deletions

View File

@ -10,6 +10,7 @@
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/unit_test_helper.h"
#include "shared/test/unit_test/utilities/base_object_utils.h"
#include "opencl/source/cl_device/cl_device.h"
@ -153,3 +154,8 @@ HWTEST_F(HwInfoConfigTest, givenHardwareInfoWhenCallingIsMaxThreadsForWorkgroupW
EXPECT_FALSE(ret);
}
HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedForPageTableManagerSupportThenReturnCorrectValue) {
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
EXPECT_EQ(hwInfoConfig.isPageTableManagerSupported(pInHwInfo), UnitTestHelper<FamilyType>::isPageTableManagerSupported(pInHwInfo));
}

View File

@ -116,6 +116,11 @@ template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::obtainBlitterPreference(const HardwareInfo &hwInfo) const {
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isPageTableManagerSupported(const HardwareInfo &hwInfo) const {
return false;
}
} // namespace NEO
struct DummyHwConfig : HwInfoConfigHw<IGFX_UNKNOWN> {
@ -636,3 +641,8 @@ HWTEST_F(HwInfoConfigTestLinuxDummy, givenHardwareInfoWhenCallingObtainBlitterPr
bool ret = hwConfig.obtainBlitterPreference(outHwInfo);
EXPECT_FALSE(ret);
}
HWTEST_F(HwInfoConfigTestLinuxDummy, givenHardwareInfoWhenCallingIsPageTableManagerSupportedThenFalseIsReturned) {
bool ret = hwConfig.isPageTableManagerSupported(outHwInfo);
EXPECT_FALSE(ret);
}

View File

@ -0,0 +1,32 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/os_interface/hw_info_config.h"
namespace NEO {
extern HwInfoConfig *hwInfoConfigFactory[IGFX_MAX_PRODUCT];
template <typename MockHwInfoConfig>
class RAIIHwInfoConfigFactory {
public:
PRODUCT_FAMILY productFamily;
HwInfoConfig *hwInfoConfig;
MockHwInfoConfig mockHwInfoConfig;
RAIIHwInfoConfigFactory(PRODUCT_FAMILY productFamily) {
this->productFamily = productFamily;
hwInfoConfig = hwInfoConfigFactory[this->productFamily];
hwInfoConfigFactory[this->productFamily] = &mockHwInfoConfig;
}
~RAIIHwInfoConfigFactory() {
hwInfoConfigFactory[this->productFamily] = hwInfoConfig;
}
};
} // namespace NEO

View File

@ -9,6 +9,7 @@
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/os_interface/hw_info_config.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/os_interface/windows/wddm/wddm.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
@ -95,6 +96,11 @@ bool HwInfoConfigHw<IGFX_UNKNOWN>::obtainBlitterPreference(const HardwareInfo &h
return false;
}
template <>
bool HwInfoConfigHw<IGFX_UNKNOWN>::isPageTableManagerSupported(const HardwareInfo &hwInfo) const {
return false;
}
HwInfoConfigTestWindows::HwInfoConfigTestWindows() {
this->executionEnvironment = std::make_unique<MockExecutionEnvironment>();
this->rootDeviceEnvironment = std::make_unique<RootDeviceEnvironment>(*executionEnvironment);
@ -177,4 +183,9 @@ HWTEST_F(HwInfoConfigTestWindows, givenHardwareInfoWhenCallingObtainBlitterPrefe
EXPECT_FALSE(ret);
}
HWTEST_F(HwInfoConfigTestWindows, givenHardwareInfoWhenCallingIsPageTableManagerSupportedThenFalseIsReturned) {
bool ret = hwConfig.isPageTableManagerSupported(outHwInfo);
EXPECT_FALSE(ret);
}
} // namespace NEO