mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 17:00:59 +08:00
Move isMidThreadPreemptionSupported helper to hwHelper
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
361a35e8a2
commit
ae88789bce
@@ -1046,6 +1046,19 @@ HWTEST2_F(HwHelperTest, givenDefaultHwHelperHwWhenGettingIsBlitCopyRequiredForLo
|
||||
EXPECT_FALSE(helper.isBlitCopyRequiredForLocalMemory(*defaultHwInfo, graphicsAllocation));
|
||||
}
|
||||
|
||||
HWTEST_F(HwHelperTest, whenIsMidThreadPreemptionSupportedIsCalledThenCorrectResultIsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
const auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
|
||||
hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = true;
|
||||
auto midThreadPreemptionSupported = hwHelper.isMidThreadPreemptionSupported(hwInfo);
|
||||
EXPECT_TRUE(midThreadPreemptionSupported);
|
||||
|
||||
hwInfo.featureTable.ftrGpGpuMidThreadLevelPreempt = false;
|
||||
midThreadPreemptionSupported = hwHelper.isMidThreadPreemptionSupported(hwInfo);
|
||||
EXPECT_FALSE(midThreadPreemptionSupported);
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, WhenIsFusedEuDispatchEnabledIsCalledThenFalseIsReturned) {
|
||||
if (hardwareInfo.platform.eRenderCoreFamily == IGFX_GEN12LP_CORE) {
|
||||
GTEST_SKIP();
|
||||
|
||||
@@ -162,19 +162,6 @@ 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);
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
|
||||
#include "opencl/extensions/public/cl_ext_private.h"
|
||||
|
||||
@@ -311,13 +312,16 @@ TEST_F(HwInfoConfigTestLinuxDummy, whenConfigureHwInfoIsCalledAndPersitentContex
|
||||
EXPECT_FALSE(drm->areNonPersistentContextsSupported());
|
||||
}
|
||||
|
||||
TEST_F(HwInfoConfigTestLinuxDummy, GivenPreemptionDrmEnabledMidThreadOnWhenConfiguringHwInfoThenPreemptionIsSupported) {
|
||||
HWTEST_F(HwInfoConfigTestLinuxDummy, GivenPreemptionDrmEnabledMidThreadOnWhenConfiguringHwInfoThenPreemptionIsSupported) {
|
||||
pInHwInfo.capabilityTable.defaultPreemptionMode = PreemptionMode::MidThread;
|
||||
drm->storedPreemptionSupport =
|
||||
I915_SCHEDULER_CAP_ENABLED |
|
||||
I915_SCHEDULER_CAP_PRIORITY |
|
||||
I915_SCHEDULER_CAP_PREEMPTION;
|
||||
drm->storedDeviceID = hwConfigTestMidThreadBit;
|
||||
|
||||
UnitTestHelper<FamilyType>::setExtraMidThreadPreemptionFlag(pInHwInfo);
|
||||
|
||||
int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, osInterface);
|
||||
EXPECT_EQ(0, ret);
|
||||
EXPECT_EQ(PreemptionMode::MidThread, outHwInfo.capabilityTable.defaultPreemptionMode);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -40,7 +40,6 @@ 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;
|
||||
@@ -78,7 +77,6 @@ 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,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) {}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -49,6 +49,8 @@ struct UnitTestHelper {
|
||||
|
||||
static bool requiresTimestampPacketsInSystemMemory();
|
||||
|
||||
static void setExtraMidThreadPreemptionFlag(HardwareInfo &hwInfo);
|
||||
|
||||
static const bool tiledImagesSupported;
|
||||
|
||||
static const uint32_t smallestTestableSimdSize;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 ×tampData) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user