Move isMidThreadPreemptionSupported helper to hwHelper

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2021-09-07 16:07:23 +00:00
committed by Compute-Runtime-Automation
parent 361a35e8a2
commit ae88789bce
12 changed files with 34 additions and 28 deletions

View File

@@ -141,6 +141,7 @@ class HwHelper {
virtual uint32_t getPlanarYuvMaxHeight() const = 0;
virtual bool isBlitterForImagesSupported(const HardwareInfo &hwInfo) const = 0;
virtual size_t getPreemptionAllocationAlignment() const = 0;
virtual bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const = 0;
virtual std::unique_ptr<TagAllocatorBase> createTimestampPacketAllocator(const std::vector<uint32_t> &rootDeviceIndices, MemoryManager *memoryManager,
size_t initialTagCount, CommandStreamReceiverType csrType,
DeviceBitfield deviceBitfield) const = 0;
@@ -382,6 +383,8 @@ class HwHelperHw : public HwHelper {
bool additionalPipeControlArgsRequired() const override;
bool isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const override;
bool isEngineTypeRemappingToHwSpecificRequired() const override;
bool isSipKernelAsHexadecimalArrayPreferred() const override;

View File

@@ -651,6 +651,11 @@ bool HwHelperHw<GfxFamily>::isEngineTypeRemappingToHwSpecificRequired() const {
return false;
}
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::isMidThreadPreemptionSupported(const HardwareInfo &hwInfo) const {
return static_cast<bool>(hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt);
}
template <typename GfxFamily>
bool HwHelperHw<GfxFamily>::isSipKernelAsHexadecimalArrayPreferred() const {
return false;

View File

@@ -40,7 +40,6 @@ class HwInfoConfig {
virtual uint64_t getSharedSystemMemCapabilities() = 0;
virtual void convertTimestampsFromOaToCsDomain(uint64_t &timestampData) = 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;
@@ -78,7 +77,6 @@ class HwInfoConfigHw : public HwInfoConfig {
void convertTimestampsFromOaToCsDomain(uint64_t &timestampData) 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;

View File

@@ -96,11 +96,6 @@ 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) {}

View File

@@ -176,7 +176,7 @@ int HwInfoConfig::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo
drm->checkPreemptionSupport();
bool preemption = drm->isPreemptionSupported();
PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable,
isMidThreadPreemptionSupported(*outHwInfo) && preemption,
hwHelper.isMidThreadPreemptionSupported(*outHwInfo) && preemption,
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuThreadGroupLevelPreempt) && preemption,
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidBatchPreempt) && preemption);

View File

@@ -28,7 +28,7 @@ int HwInfoConfig::configureHwInfoWddm(const HardwareInfo *inHwInfo, HardwareInfo
outHwInfo->capabilityTable.ftrSupportsCoherency &= inHwInfo->featureTable.ftrL3IACoherency;
PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable,
isMidThreadPreemptionSupported(*outHwInfo),
hwHelper.isMidThreadPreemptionSupported(*outHwInfo),
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuThreadGroupLevelPreempt),
static_cast<bool>(outHwInfo->featureTable.ftrGpGpuMidBatchPreempt));

View File

@@ -49,6 +49,8 @@ struct UnitTestHelper {
static bool requiresTimestampPacketsInSystemMemory();
static void setExtraMidThreadPreemptionFlag(HardwareInfo &hwInfo);
static const bool tiledImagesSupported;
static const uint32_t smallestTestableSimdSize;

View File

@@ -80,6 +80,10 @@ inline bool UnitTestHelper<GfxFamily>::requiresTimestampPacketsInSystemMemory()
return true;
}
template <typename GfxFamily>
void UnitTestHelper<GfxFamily>::setExtraMidThreadPreemptionFlag(HardwareInfo &hwInfo) {
}
template <typename GfxFamily>
auto UnitTestHelper<GfxFamily>::getCoherencyTypeSupported(COHERENCY_TYPE coherencyType) -> decltype(coherencyType) {
return coherencyType;

View File

@@ -13,11 +13,6 @@ 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 &timestampData) {
}