mirror of
https://github.com/intel/compute-runtime.git
synced 2025-11-10 05:49:51 +08:00
Add isMidThreadPreemptionSupported helper
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
4f15365dae
commit
9794bafd91
@@ -162,6 +162,19 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedForPageTableManagerSupportT
|
||||
EXPECT_EQ(hwInfoConfig.isPageTableManagerSupported(pInHwInfo), UnitTestHelper<FamilyType>::isPageTableManagerSupported(pInHwInfo));
|
||||
}
|
||||
|
||||
HWTEST_F(HwInfoConfigTest, whenIsMidThreadPreemptionSupportedIsCalledThenCorrectResultIsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
|
||||
auto hwInfo = pInHwInfo;
|
||||
|
||||
hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = true;
|
||||
auto midThreadPreemptionSupported = hwInfoConfig.isMidThreadPreemptionSupported(hwInfo);
|
||||
EXPECT_TRUE(midThreadPreemptionSupported);
|
||||
|
||||
hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = false;
|
||||
midThreadPreemptionSupported = hwInfoConfig.isMidThreadPreemptionSupported(hwInfo);
|
||||
EXPECT_FALSE(midThreadPreemptionSupported);
|
||||
}
|
||||
|
||||
HWTEST_F(HwInfoConfigTest, givenVariousValuesWhenConvertingHwRevIdAndSteppingThenConversionIsCorrect) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ class HwInfoConfig {
|
||||
virtual uint64_t getSharedSystemMemCapabilities() = 0;
|
||||
virtual void convertTimestampsFromOaToCsDomain(uint64_t ×tampData) = 0;
|
||||
virtual uint32_t getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) = 0;
|
||||
virtual bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isAdditionalStateBaseAddressWARequired(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual uint32_t getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const = 0;
|
||||
@@ -76,6 +77,7 @@ class HwInfoConfigHw : public HwInfoConfig {
|
||||
void convertTimestampsFromOaToCsDomain(uint64_t ×tampData) override;
|
||||
uint32_t getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) override;
|
||||
bool isAdditionalStateBaseAddressWARequired(const HardwareInfo &hwInfo) const override;
|
||||
bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const override;
|
||||
bool isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const override;
|
||||
uint32_t getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const override;
|
||||
uint32_t getMaxThreadsForWorkgroup(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice) const override;
|
||||
|
||||
@@ -96,6 +96,11 @@ uint32_t HwInfoConfigHw<gfxProduct>::getMaxThreadsForWorkgroup(const HardwareInf
|
||||
return maxNumEUsPerSubSlice * numThreadsPerEU;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool HwInfoConfigHw<gfxProduct>::isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const {
|
||||
return static_cast<bool>(hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt);
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
void HwInfoConfigHw<gfxProduct>::setForceNonCoherent(void *const commandPtr, const StateComputeModeProperties &properties) {}
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ int HwInfoConfig::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo
|
||||
drm->checkPreemptionSupport();
|
||||
bool preemption = drm->isPreemptionSupported();
|
||||
PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable,
|
||||
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidThreadLevelPreempt) && preemption,
|
||||
isMidThreadPreemptionSupported(*outHwInfo) && preemption,
|
||||
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuThreadGroupLevelPreempt) && preemption,
|
||||
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidBatchPreempt) && preemption);
|
||||
|
||||
|
||||
@@ -28,9 +28,10 @@ int HwInfoConfig::configureHwInfoWddm(const HardwareInfo *inHwInfo, HardwareInfo
|
||||
outHwInfo->capabilityTable.ftrSupportsCoherency &= inHwInfo->featureTable.ftrL3IACoherency;
|
||||
|
||||
PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable,
|
||||
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidThreadLevelPreempt),
|
||||
isMidThreadPreemptionSupported(*outHwInfo),
|
||||
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuThreadGroupLevelPreempt),
|
||||
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidBatchPreempt));
|
||||
|
||||
if (DebugManager.flags.OverridePreemptionSurfaceSizeInMb.get() >= 0) {
|
||||
outHwInfo->gtSystemInfo.CsrSizeInMb = static_cast<uint32_t>(DebugManager.flags.OverridePreemptionSurfaceSizeInMb.get());
|
||||
}
|
||||
|
||||
@@ -13,6 +13,11 @@ template <>
|
||||
void HwInfoConfigHw<IGFX_UNKNOWN>::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) {
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<IGFX_UNKNOWN>::isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const {
|
||||
return static_cast<bool>(hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt);
|
||||
}
|
||||
|
||||
template <>
|
||||
void HwInfoConfigHw<IGFX_UNKNOWN>::convertTimestampsFromOaToCsDomain(uint64_t ×tampData) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user