add pipeline select hw properties support flags

Related-To: NEO-5019

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2022-09-12 19:11:56 +00:00
committed by Compute-Runtime-Automation
parent 3ec0ceb2bf
commit 647661e701
36 changed files with 295 additions and 15 deletions

View File

@@ -438,7 +438,9 @@ struct UnknownProduct {
};
struct PipelineSelectStateSupport {
static constexpr bool commandSupport = false;
static constexpr bool modeSelected = false;
static constexpr bool mediaSamplerDopClockGate = false;
static constexpr bool systolicMode = false;
};
struct PreemptionDebugSupport {

View File

@@ -31,4 +31,12 @@ std::vector<StreamProperty *> getAllFrontEndProperties(FrontEndProperties &prope
return allProperties;
}
std::vector<StreamProperty *> getAllPipelineSelectProperties(PipelineSelectProperties &properties) {
std::vector<StreamProperty *> allProperties;
allProperties.push_back(&properties.modeSelected);
allProperties.push_back(&properties.mediaSamplerDopClockGate);
allProperties.push_back(&properties.systolicMode);
return allProperties;
}
} // namespace NEO

View File

@@ -22,6 +22,11 @@ struct MockFrontEndProperties : public FrontEndProperties {
using FrontEndProperties::propertiesSupportLoaded;
};
struct MockPipelineSelectProperties : public PipelineSelectProperties {
using PipelineSelectProperties::pipelineSelectPropertiesSupport;
using PipelineSelectProperties::propertiesSupportLoaded;
};
TEST(StreamPropertiesTests, whenPropertyValueIsChangedThenProperStateIsSet) {
NEO::StreamProperty streamProperty;
@@ -191,13 +196,17 @@ void verifyIsDirty() {
}
TEST(StreamPropertiesTests, givenVariousStatesOfStateComputeModePropertiesWhenIsDirtyIsQueriedThenCorrectValueIsReturned) {
verifyIsDirty<StateComputeModeProperties, &getAllStateComputeModeProperties>();
verifyIsDirty<StateComputeModeProperties, getAllStateComputeModeProperties>();
}
TEST(StreamPropertiesTests, givenVariousStatesOfFrontEndPropertiesWhenIsDirtyIsQueriedThenCorrectValueIsReturned) {
verifyIsDirty<FrontEndProperties, getAllFrontEndProperties>();
}
TEST(StreamPropertiesTests, givenVariousStatesOfPipelineSelectPropertiesWhenIsDirtyIsQueriedThenCorrectValueIsReturned) {
verifyIsDirty<PipelineSelectProperties, getAllPipelineSelectProperties>();
}
template <typename PropertiesT, getAllPropertiesFunctionPtr<PropertiesT> getAllProperties>
void verifySettingPropertiesFromOtherStruct() {
PropertiesT propertiesDestination;
@@ -242,6 +251,10 @@ TEST(StreamPropertiesTests, givenOtherFrontEndPropertiesStructWhenSetPropertiesI
verifySettingPropertiesFromOtherStruct<FrontEndProperties, getAllFrontEndProperties>();
}
TEST(StreamPropertiesTests, givenOtherPipelineSelectPropertiesStructWhenSetPropertiesIsCalledThenCorrectValuesAreSet) {
verifySettingPropertiesFromOtherStruct<PipelineSelectProperties, getAllPipelineSelectProperties>();
}
TEST(StreamPropertiesTests, givenSingleDispatchCcsFrontEndPropertyWhenSettingPropertyAndCheckIfSupportedThenExpectCorrectState) {
FrontEndPropertiesSupport fePropertiesSupport{};
auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
@@ -269,3 +282,56 @@ TEST(StreamPropertiesTests, givenSingleDispatchCcsFrontEndPropertyWhenSettingPro
EXPECT_TRUE(feProperties.singleSliceDispatchCcsMode.isDirty);
EXPECT_EQ(engineInstancedDevice, feProperties.singleSliceDispatchCcsMode.value);
}
TEST(StreamPropertiesTests, whenSettingPipelineSelectPropertiesThenCorrectValueIsSet) {
StreamProperties properties;
PipelineSelectPropertiesSupport pipelineSelectPropertiesSupport = {};
auto hwInfoConfig = HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
hwInfoConfig->fillPipelineSelectPropertiesSupportStructure(pipelineSelectPropertiesSupport, *defaultHwInfo);
for (auto modeSelected : ::testing::Bool()) {
for (auto mediaSamplerDopClockGate : ::testing::Bool()) {
for (auto systolicMode : ::testing::Bool()) {
properties.pipelineSelect.setProperties(modeSelected, mediaSamplerDopClockGate, systolicMode, *defaultHwInfo);
if (pipelineSelectPropertiesSupport.modeSelected) {
EXPECT_EQ(modeSelected, properties.pipelineSelect.modeSelected.value);
} else {
EXPECT_EQ(-1, properties.pipelineSelect.modeSelected.value);
}
if (pipelineSelectPropertiesSupport.mediaSamplerDopClockGate) {
EXPECT_EQ(mediaSamplerDopClockGate, properties.pipelineSelect.mediaSamplerDopClockGate.value);
} else {
EXPECT_EQ(-1, properties.pipelineSelect.mediaSamplerDopClockGate.value);
}
if (pipelineSelectPropertiesSupport.systolicMode) {
EXPECT_EQ(systolicMode, properties.pipelineSelect.systolicMode.value);
} else {
EXPECT_EQ(-1, properties.pipelineSelect.systolicMode.value);
}
}
}
}
}
TEST(StreamPropertiesTests, givenModeSelectPipelineSelectPropertyNotSupportedWhenSettingPropertyAndCheckIfDirtyThenExpectCleanState) {
MockPipelineSelectProperties pipeProperties{};
pipeProperties.propertiesSupportLoaded = true;
pipeProperties.pipelineSelectPropertiesSupport.modeSelected = false;
pipeProperties.pipelineSelectPropertiesSupport.mediaSamplerDopClockGate = true;
pipeProperties.pipelineSelectPropertiesSupport.systolicMode = true;
constexpr bool constState = false;
bool changingState = false;
pipeProperties.setProperties(changingState, constState, constState, *defaultHwInfo);
// expect dirty as media and systolic changes from initial registered
EXPECT_TRUE(pipeProperties.isDirty());
changingState = !changingState;
pipeProperties.setProperties(changingState, constState, constState, *defaultHwInfo);
// expect clean as changed modeSelected is not supported
EXPECT_FALSE(pipeProperties.isDirty());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 Intel Corporation
* Copyright (C) 2021-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -12,10 +12,12 @@
namespace NEO {
struct FrontEndProperties;
struct PipelineSelectProperties;
struct StateComputeModeProperties;
struct StreamProperty;
std::vector<StreamProperty *> getAllStateComputeModeProperties(StateComputeModeProperties &properties);
std::vector<StreamProperty *> getAllFrontEndProperties(FrontEndProperties &properties);
std::vector<StreamProperty *> getAllPipelineSelectProperties(PipelineSelectProperties &properties);
} // namespace NEO

View File

@@ -106,4 +106,8 @@ EHLTEST_F(EhlHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThen
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -133,4 +133,8 @@ ICLLPTEST_F(IcllpHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupport
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -125,4 +125,8 @@ LKFTEST_F(LkfHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThen
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -108,4 +108,8 @@ ADLNTEST_F(AdlnHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportTh
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -108,4 +108,8 @@ ADLPTEST_F(AdlpHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportTh
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -108,4 +108,8 @@ ADLSTEST_F(AdlsHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportTh
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -174,4 +174,8 @@ DG1TEST_F(Dg1HwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThen
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -118,4 +118,8 @@ RKLTEST_F(RklHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThen
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -46,4 +46,8 @@ TGLLPTEST_F(HwInfoConfigTestTgllp, givenHwInfoConfigWhenGetCommandsStreamPropert
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -126,4 +126,8 @@ BDWTEST_F(BdwHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThen
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -132,4 +132,8 @@ BXTTEST_F(BxtHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThen
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -139,4 +139,8 @@ CFLTEST_F(CflHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThen
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -122,4 +122,8 @@ GLKTEST_F(GlkHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThen
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -146,4 +146,8 @@ KBLTEST_F(KblHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThen
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -146,4 +146,8 @@ SKLTEST_F(SklHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThen
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -532,3 +532,14 @@ HWTEST_F(HwInfoConfigTest, WhenFillingFrontEndPropertiesSupportThenExpectUseCorr
EXPECT_EQ(hwInfoConfig->getFrontEndPropertyDisableOverDispatchSupport(), frontEndPropertiesSupport.disableOverdispatch);
EXPECT_EQ(hwInfoConfig->getFrontEndPropertySingleSliceDispatchCcsModeSupport(), frontEndPropertiesSupport.singleSliceDispatchCcsMode);
}
HWTEST_F(HwInfoConfigTest, WhenFillingPipelineSelectPropertiesSupportThenExpectUseCorrectGetters) {
PipelineSelectPropertiesSupport pipelineSelectPropertiesSupport = {};
auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
hwInfoConfig->fillPipelineSelectPropertiesSupportStructure(pipelineSelectPropertiesSupport, pInHwInfo);
EXPECT_EQ(hwInfoConfig->getPipelineSelectPropertyModeSelectedSupport(), pipelineSelectPropertiesSupport.modeSelected);
EXPECT_EQ(hwInfoConfig->getPipelineSelectPropertyMediaSamplerDopClockGateSupport(), pipelineSelectPropertiesSupport.mediaSamplerDopClockGate);
EXPECT_EQ(hwInfoConfig->getPipelineSelectPropertySystolicModeSupport(), pipelineSelectPropertiesSupport.systolicMode);
}

View File

@@ -46,4 +46,8 @@ XEHPTEST_F(HwInfoConfigTestXeHpSdv, givenHwInfoConfigWhenGetCommandsStreamProper
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -116,4 +116,8 @@ PVCTEST_F(PVCHwInfoConfig, givenHwInfoConfigWhenGetCommandsStreamPropertiesSuppo
EXPECT_FALSE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}

View File

@@ -96,4 +96,8 @@ DG2TEST_F(TestDg2HwInfoConfig, givenHwInfoConfigWhenGetCommandsStreamPropertiesS
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyDisableEuFusionSupport());
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertyDisableOverDispatchSupport());
EXPECT_TRUE(hwInfoConfig.getFrontEndPropertySingleSliceDispatchCcsModeSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertyModeSelectedSupport());
EXPECT_FALSE(hwInfoConfig.getPipelineSelectPropertyMediaSamplerDopClockGateSupport());
EXPECT_TRUE(hwInfoConfig.getPipelineSelectPropertySystolicModeSupport());
}