mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Enable implicit scaling via platform config
Related-To: NEO-6819 Signed-off-by: Daniel Chabrowski <daniel.chabrowski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
630ecfdd09
commit
b5495169ca
@@ -110,6 +110,7 @@ class HwInfoConfig {
|
||||
virtual bool allowMemoryPrefetch(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isBcsReportWaRequired(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const = 0;
|
||||
virtual bool isImplicitScalingSupported(const HardwareInfo &hwInfo) const = 0;
|
||||
|
||||
MOCKABLE_VIRTUAL ~HwInfoConfig() = default;
|
||||
|
||||
@@ -202,6 +203,7 @@ class HwInfoConfigHw : public HwInfoConfig {
|
||||
bool allowMemoryPrefetch(const HardwareInfo &hwInfo) const override;
|
||||
bool isBcsReportWaRequired(const HardwareInfo &hwInfo) const override;
|
||||
bool isBlitCopyRequiredForLocalMemory(const HardwareInfo &hwInfo, const GraphicsAllocation &allocation) const override;
|
||||
bool isImplicitScalingSupported(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
protected:
|
||||
HwInfoConfigHw() = default;
|
||||
|
||||
@@ -399,4 +399,9 @@ bool HwInfoConfigHw<gfxProduct>::isBlitCopyRequiredForLocalMemory(const Hardware
|
||||
(HwInfoConfig::get(hwInfo.platform.eProductFamily)->getLocalMemoryAccessMode(hwInfo) == LocalMemoryAccessMode::CpuAccessDisallowed ||
|
||||
!allocation.isAllocationLockable());
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool HwInfoConfigHw<gfxProduct>::isImplicitScalingSupported(const HardwareInfo &hwInfo) const {
|
||||
return false;
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
@@ -134,3 +134,8 @@ template <>
|
||||
bool HwInfoConfigHw<gfxProduct>::isBlitterForImagesSupported() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<gfxProduct>::isImplicitScalingSupported(const HardwareInfo &hwInfo) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ bool ImplicitScalingDispatch<Family>::platformSupportsImplicitScaling(const Hard
|
||||
if (ApiSpecificConfig::getApiType() == ApiSpecificConfig::ApiType::OCL) {
|
||||
return true;
|
||||
} else {
|
||||
return HwInfoConfig::get(hwInfo.platform.eProductFamily)->getSteppingFromHwRevId(hwInfo) >= REVISION_B;
|
||||
return HwInfoConfig::get(hwInfo.platform.eProductFamily)->isImplicitScalingSupported(hwInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ bool HwInfoConfigHw<gfxProduct>::isAdjustProgrammableIdPreferredSlmSizeRequired(
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<gfxProduct>::isCooperativeEngineSupported(const HardwareInfo &hwInfo) const {
|
||||
return (HwInfoConfig::get(hwInfo.platform.eProductFamily)->getSteppingFromHwRevId(hwInfo) >= REVISION_B);
|
||||
return getSteppingFromHwRevId(hwInfo) >= REVISION_B;
|
||||
}
|
||||
|
||||
bool isBaseDieA0(const HardwareInfo &hwInfo) {
|
||||
@@ -174,3 +174,8 @@ bool HwInfoConfigHw<gfxProduct>::isBlitCopyRequiredForLocalMemory(const Hardware
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<gfxProduct>::isImplicitScalingSupported(const HardwareInfo &hwInfo) const {
|
||||
return getSteppingFromHwRevId(hwInfo) >= REVISION_B;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -136,3 +136,8 @@ XEHPTEST_F(TestXeHPHwInfoConfig, givenXeHpCoreWhenIsBlitterForImagesSupportedIsC
|
||||
|
||||
EXPECT_TRUE(hwInfoConfig.isBlitterForImagesSupported());
|
||||
}
|
||||
|
||||
XEHPTEST_F(TestXeHPHwInfoConfig, givenHwInfoConfigWhenIsImplicitScalingSupportedThenExpectTrue) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
EXPECT_TRUE(hwInfoConfig.isImplicitScalingSupported(*defaultHwInfo));
|
||||
}
|
||||
|
||||
@@ -69,3 +69,8 @@ HWTEST_F(HwInfoConfigTest, givenForceGrfNumProgrammingWithScmFlagSetWhenIsGrfNum
|
||||
DebugManager.flags.ForceGrfNumProgrammingWithScm.set(1);
|
||||
EXPECT_TRUE(hwInfoConfig.isGrfNumReportedWithScm());
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenIsImplicitScalingSupportedThenExpectFalse, isNotXeHpOrXeHpcCore) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
EXPECT_FALSE(hwInfoConfig.isImplicitScalingSupported(*defaultHwInfo));
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
@@ -29,3 +30,18 @@ PVCTEST_F(PVCHwInfoConfig, givenPVCRevId0WhenGettingThreadEuRatioForScratchThen8
|
||||
hwInfo.platform.usRevId = 0;
|
||||
EXPECT_EQ(8u, hwInfoConfig.getThreadEuRatioForScratch(hwInfo));
|
||||
}
|
||||
|
||||
PVCTEST_F(PVCHwInfoConfig, givenPVCWithDifferentSteppingsThenImplicitScalingIsEnabledForBAndHigher) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
for (uint32_t stepping = 0; stepping < 0x10; stepping++) {
|
||||
auto hwRevIdFromStepping = hwInfoConfig.getHwRevIdFromStepping(stepping, hwInfo);
|
||||
if (hwRevIdFromStepping != CommonConstants::invalidStepping) {
|
||||
hwInfo.platform.usRevId = hwRevIdFromStepping;
|
||||
const bool shouldSupportImplicitScaling = hwRevIdFromStepping >= REVISION_B;
|
||||
EXPECT_EQ(shouldSupportImplicitScaling, hwInfoConfig.isImplicitScalingSupported(hwInfo)) << "hwRevId: " << hwRevIdFromStepping;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user