mirror of
https://github.com/intel/compute-runtime.git
synced 2025-11-10 05:49:51 +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);
|
||||
|
||||
Reference in New Issue
Block a user