refactor: don't use global ProductHelper getter 7/n
Related-To: NEO-6853 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
parent
11764dd9bf
commit
1758f55fe3
|
@ -2348,7 +2348,7 @@ void CommandListCoreFamily<gfxCoreFamily>::updateStreamProperties(Kernel &kernel
|
|||
auto &kernelAttributes = kernel.getKernelDescriptor().kernelAttributes;
|
||||
if (!containsAnyKernel) {
|
||||
requiredStreamState.frontEndState.setProperties(isCooperative, kernelAttributes.flags.requiresDisabledEUFusion, true, -1, rootDeviceEnvironment);
|
||||
requiredStreamState.pipelineSelect.setProperties(true, false, kernelAttributes.flags.usesSystolicPipelineSelectMode, hwInfo);
|
||||
requiredStreamState.pipelineSelect.setProperties(true, false, kernelAttributes.flags.usesSystolicPipelineSelectMode, rootDeviceEnvironment);
|
||||
if (this->stateComputeModeTracking) {
|
||||
requiredStreamState.stateComputeMode.setProperties(false, kernelAttributes.numGrfRequired, kernelAttributes.threadArbitrationPolicy, device->getDevicePreemptionMode(), rootDeviceEnvironment);
|
||||
finalStreamState = requiredStreamState;
|
||||
|
@ -2361,7 +2361,7 @@ void CommandListCoreFamily<gfxCoreFamily>::updateStreamProperties(Kernel &kernel
|
|||
|
||||
auto logicalStateHelperBlock = !getLogicalStateHelper();
|
||||
|
||||
finalStreamState.pipelineSelect.setProperties(true, false, kernelAttributes.flags.usesSystolicPipelineSelectMode, hwInfo);
|
||||
finalStreamState.pipelineSelect.setProperties(true, false, kernelAttributes.flags.usesSystolicPipelineSelectMode, rootDeviceEnvironment);
|
||||
if (this->pipelineSelectStateTracking && finalStreamState.pipelineSelect.isDirty() && logicalStateHelperBlock) {
|
||||
NEO::PipelineSelectArgs pipelineSelectArgs;
|
||||
pipelineSelectArgs.systolicPipelineSelectMode = kernelAttributes.flags.usesSystolicPipelineSelectMode;
|
||||
|
|
|
@ -314,7 +314,7 @@ void CommandQueueHw<gfxCoreFamily>::programOneCmdListFrontEndIfDirty(
|
|||
|
||||
if (frontEndTrackingEnabled()) {
|
||||
csrState.frontEndState.setProperties(cmdListRequired.frontEndState);
|
||||
csrState.frontEndState.setPropertySingleSliceDispatchCcsMode(ctx.engineInstanced, device->getHwInfo());
|
||||
csrState.frontEndState.setPropertySingleSliceDispatchCcsMode(ctx.engineInstanced, device->getNEODevice()->getRootDeviceEnvironment());
|
||||
|
||||
shouldProgramVfe |= csrState.frontEndState.isDirty();
|
||||
}
|
||||
|
@ -391,7 +391,7 @@ size_t CommandQueueHw<gfxCoreFamily>::estimateFrontEndCmdSizeForMultipleCommandL
|
|||
size_t estimatedSize = 0;
|
||||
|
||||
csrStateCopy.frontEndState.setProperties(cmdListRequired.frontEndState);
|
||||
csrStateCopy.frontEndState.setPropertySingleSliceDispatchCcsMode(engineInstanced, device->getHwInfo());
|
||||
csrStateCopy.frontEndState.setPropertySingleSliceDispatchCcsMode(engineInstanced, device->getNEODevice()->getRootDeviceEnvironment());
|
||||
if (isFrontEndStateDirty || csrStateCopy.frontEndState.isDirty()) {
|
||||
estimatedSize += singleFrontEndCmdSize;
|
||||
isFrontEndStateDirty = false;
|
||||
|
@ -1191,7 +1191,7 @@ size_t CommandQueueHw<gfxCoreFamily>::estimateScmCmdSizeForMultipleCommandLists(
|
|||
size_t estimatedSize = 0;
|
||||
|
||||
bool isRcs = this->getCsr()->isRcs();
|
||||
size_t singleScmCmdSize = NEO::EncodeComputeMode<GfxFamily>::getCmdSizeForComputeMode(device->getHwInfo(), false, isRcs);
|
||||
size_t singleScmCmdSize = NEO::EncodeComputeMode<GfxFamily>::getCmdSizeForComputeMode(device->getNEODevice()->getRootDeviceEnvironment(), false, isRcs);
|
||||
|
||||
csrStateCopy.stateComputeMode.setProperties(cmdListRequired.stateComputeMode);
|
||||
if (csrStateCopy.stateComputeMode.isDirty()) {
|
||||
|
|
|
@ -162,7 +162,7 @@ HWTEST_F(UltCommandStreamReceiverTest, givenPreambleSentAndThreadArbitrationPoli
|
|||
|
||||
auto actualDifferenceForPreamble = policyChangedPreamble - policyNotChangedPreamble;
|
||||
auto actualDifferenceForFlush = policyChangedFlush - policyNotChangedFlush;
|
||||
auto expectedDifference = EncodeComputeMode<FamilyType>::getCmdSizeForComputeMode(*defaultHwInfo, false, commandStreamReceiver.isRcs());
|
||||
auto expectedDifference = EncodeComputeMode<FamilyType>::getCmdSizeForComputeMode(pDevice->getRootDeviceEnvironment(), false, commandStreamReceiver.isRcs());
|
||||
EXPECT_EQ(0u, actualDifferenceForPreamble);
|
||||
EXPECT_EQ(expectedDifference, actualDifferenceForFlush);
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ struct UltCommandStreamReceiverTest
|
|||
|
||||
commandStreamReceiver.lastMediaSamplerConfig = 0;
|
||||
commandStreamReceiver.lastSentUseGlobalAtomics = false;
|
||||
commandStreamReceiver.streamProperties.pipelineSelect.setProperties(true, false, false, *defaultHwInfo);
|
||||
commandStreamReceiver.streamProperties.pipelineSelect.setProperties(true, false, false, pDevice->getRootDeviceEnvironment());
|
||||
commandStreamReceiver.streamProperties.stateComputeMode.setProperties(0, GrfConfig::DefaultGrfNumber,
|
||||
gfxCoreHelper.getDefaultThreadArbitrationPolicy(), pDevice->getPreemptionMode(), pDevice->getRootDeviceEnvironment());
|
||||
commandStreamReceiver.streamProperties.frontEndState.setProperties(false, false, false, -1, pDevice->getRootDeviceEnvironment());
|
||||
|
|
|
@ -333,7 +333,7 @@ struct EncodeStoreMMIO {
|
|||
|
||||
template <typename GfxFamily>
|
||||
struct EncodeComputeMode {
|
||||
static size_t getCmdSizeForComputeMode(const HardwareInfo &hwInfo, bool hasSharedHandles, bool isRcs);
|
||||
static size_t getCmdSizeForComputeMode(const RootDeviceEnvironment &rootDeviceEnvironment, bool hasSharedHandles, bool isRcs);
|
||||
static void programComputeModeCommandWithSynchronization(LinearStream &csr, StateComputeModeProperties &properties,
|
||||
const PipelineSelectArgs &args, bool hasSharedHandles,
|
||||
const RootDeviceEnvironment &rootDeviceEnvironment, bool isRcs, bool dcFlush, LogicalStateHelper *logicalStateHelper);
|
||||
|
|
|
@ -13,9 +13,10 @@
|
|||
namespace NEO {
|
||||
|
||||
template <typename Family>
|
||||
size_t EncodeComputeMode<Family>::getCmdSizeForComputeMode(const HardwareInfo &hwInfo, bool hasSharedHandles, bool isRcs) {
|
||||
size_t EncodeComputeMode<Family>::getCmdSizeForComputeMode(const RootDeviceEnvironment &rootDeviceEnvironment, bool hasSharedHandles, bool isRcs) {
|
||||
size_t size = 0;
|
||||
auto &productHelper = (*ProductHelper::get(hwInfo.platform.eProductFamily));
|
||||
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
|
||||
const auto &[isBasicWARequired, isExtendedWARequired] = productHelper.isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, isRcs);
|
||||
std::ignore = isExtendedWARequired;
|
||||
|
||||
|
|
|
@ -1581,7 +1581,7 @@ bool CommandStreamReceiverHw<GfxFamily>::hasSharedHandles() {
|
|||
|
||||
template <typename GfxFamily>
|
||||
size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForComputeMode() {
|
||||
return EncodeComputeMode<GfxFamily>::getCmdSizeForComputeMode(this->peekHwInfo(), hasSharedHandles(), isRcs());
|
||||
return EncodeComputeMode<GfxFamily>::getCmdSizeForComputeMode(this->peekRootDeviceEnvironment(), hasSharedHandles(), isRcs());
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2019-2022 Intel Corporation
|
||||
* Copyright (C) 2019-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -66,7 +66,7 @@ void CommandStreamReceiverHw<GfxFamily>::programPipelineSelect(LinearStream &com
|
|||
}
|
||||
this->lastMediaSamplerConfig = pipelineSelectArgs.mediaSamplerRequired;
|
||||
this->lastSystolicPipelineSelectMode = pipelineSelectArgs.systolicPipelineSelectMode;
|
||||
this->streamProperties.pipelineSelect.setProperties(true, this->lastMediaSamplerConfig, this->lastSystolicPipelineSelectMode, hwInfo);
|
||||
this->streamProperties.pipelineSelect.setProperties(true, this->lastMediaSamplerConfig, this->lastSystolicPipelineSelectMode, peekRootDeviceEnvironment());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ void CommandStreamReceiverHw<GfxFamily>::programPipelineSelect(LinearStream &com
|
|||
PreambleHelper<GfxFamily>::programPipelineSelect(&commandStream, pipelineSelectArgs, hwInfo);
|
||||
this->lastMediaSamplerConfig = pipelineSelectArgs.mediaSamplerRequired;
|
||||
this->lastSystolicPipelineSelectMode = pipelineSelectArgs.systolicPipelineSelectMode;
|
||||
this->streamProperties.pipelineSelect.setProperties(true, this->lastMediaSamplerConfig, this->lastSystolicPipelineSelectMode, hwInfo);
|
||||
this->streamProperties.pipelineSelect.setProperties(true, this->lastMediaSamplerConfig, this->lastSystolicPipelineSelectMode, peekRootDeviceEnvironment());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ struct FrontEndProperties {
|
|||
|
||||
void setProperties(bool isCooperativeKernel, bool disableEUFusion, bool disableOverdispatch, int32_t engineInstancedDevice, const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
void setProperties(const FrontEndProperties &properties);
|
||||
void setPropertySingleSliceDispatchCcsMode(int32_t engineInstancedDevice, const HardwareInfo &hwInfo);
|
||||
void setPropertySingleSliceDispatchCcsMode(int32_t engineInstancedDevice, const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
bool isDirty() const;
|
||||
|
||||
protected:
|
||||
|
@ -81,7 +81,7 @@ struct PipelineSelectProperties {
|
|||
StreamProperty mediaSamplerDopClockGate{};
|
||||
StreamProperty systolicMode{};
|
||||
|
||||
void setProperties(bool modeSelected, bool mediaSamplerDopClockGate, bool systolicMode, const HardwareInfo &hwInfo);
|
||||
void setProperties(bool modeSelected, bool mediaSamplerDopClockGate, bool systolicMode, const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
void setProperties(const PipelineSelectProperties &properties);
|
||||
bool isDirty() const;
|
||||
|
||||
|
@ -112,7 +112,7 @@ struct StateBaseAddressProperties {
|
|||
void setProperties(bool globalAtomics, int32_t statelessMocs, int64_t bindingTablePoolBaseAddress,
|
||||
int64_t surfaceStateBaseAddress, size_t surfaceStateSize,
|
||||
int64_t dynamicStateBaseAddress, size_t dynamicStateSize,
|
||||
int64_t indirectObjectBaseAddress, size_t indirectObjectSize, const HardwareInfo &hwInfo);
|
||||
int64_t indirectObjectBaseAddress, size_t indirectObjectSize, const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
void setProperties(const StateBaseAddressProperties &properties);
|
||||
bool isDirty() const;
|
||||
|
||||
|
|
|
@ -132,9 +132,10 @@ void FrontEndProperties::setProperties(bool isCooperativeKernel, bool disableEUF
|
|||
}
|
||||
}
|
||||
|
||||
void FrontEndProperties::setPropertySingleSliceDispatchCcsMode(int32_t engineInstancedDevice, const HardwareInfo &hwInfo) {
|
||||
void FrontEndProperties::setPropertySingleSliceDispatchCcsMode(int32_t engineInstancedDevice, const RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
if (this->propertiesSupportLoaded == false) {
|
||||
auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily);
|
||||
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
|
||||
productHelper.fillFrontEndPropertiesSupportStructure(this->frontEndPropertiesSupport, hwInfo);
|
||||
this->propertiesSupportLoaded = true;
|
||||
}
|
||||
|
@ -165,10 +166,11 @@ void FrontEndProperties::clearIsDirty() {
|
|||
computeDispatchAllWalkerEnable.isDirty = false;
|
||||
}
|
||||
|
||||
void PipelineSelectProperties::setProperties(bool modeSelected, bool mediaSamplerDopClockGate, bool systolicMode, const HardwareInfo &hwInfo) {
|
||||
void PipelineSelectProperties::setProperties(bool modeSelected, bool mediaSamplerDopClockGate, bool systolicMode, const RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
if (this->propertiesSupportLoaded == false) {
|
||||
auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily);
|
||||
productHelper.fillPipelineSelectPropertiesSupportStructure(this->pipelineSelectPropertiesSupport, hwInfo);
|
||||
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
|
||||
productHelper.fillPipelineSelectPropertiesSupportStructure(this->pipelineSelectPropertiesSupport, *rootDeviceEnvironment.getHardwareInfo());
|
||||
this->propertiesSupportLoaded = true;
|
||||
}
|
||||
|
||||
|
@ -208,10 +210,10 @@ void PipelineSelectProperties::clearIsDirty() {
|
|||
void StateBaseAddressProperties::setProperties(bool globalAtomics, int32_t statelessMocs, int64_t bindingTablePoolBaseAddress,
|
||||
int64_t surfaceStateBaseAddress, size_t surfaceStateSize,
|
||||
int64_t dynamicStateBaseAddress, size_t dynamicStateSize,
|
||||
int64_t indirectObjectBaseAddress, size_t indirectObjectSize, const HardwareInfo &hwInfo) {
|
||||
int64_t indirectObjectBaseAddress, size_t indirectObjectSize, const RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
if (this->propertiesSupportLoaded == false) {
|
||||
auto &productHelper = *ProductHelper::get(hwInfo.platform.eProductFamily);
|
||||
productHelper.fillStateBaseAddressPropertiesSupportStructure(this->stateBaseAddressPropertiesSupport, hwInfo);
|
||||
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
productHelper.fillStateBaseAddressPropertiesSupportStructure(this->stateBaseAddressPropertiesSupport);
|
||||
this->propertiesSupportLoaded = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ void EncodeSurfaceState<Family>::setFlagsForMediaCompression(R_SURFACE_STATE *su
|
|||
}
|
||||
|
||||
template <typename Family>
|
||||
size_t EncodeComputeMode<Family>::getCmdSizeForComputeMode(const HardwareInfo &hwInfo, bool hasSharedHandles, bool isRcs) {
|
||||
size_t EncodeComputeMode<Family>::getCmdSizeForComputeMode(const RootDeviceEnvironment &rootDeviceEnvironment, bool hasSharedHandles, bool isRcs) {
|
||||
return sizeof(typename Family::PIPE_CONTROL) + 2u * sizeof(typename Family::MI_LOAD_REGISTER_IMM);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ void EncodeSurfaceState<Family>::setFlagsForMediaCompression(R_SURFACE_STATE *su
|
|||
}
|
||||
|
||||
template <typename Family>
|
||||
size_t EncodeComputeMode<Family>::getCmdSizeForComputeMode(const HardwareInfo &hwInfo, bool hasSharedHandles, bool isRcs) {
|
||||
size_t EncodeComputeMode<Family>::getCmdSizeForComputeMode(const RootDeviceEnvironment &rootDeviceEnvironment, bool hasSharedHandles, bool isRcs) {
|
||||
return 0u;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ void EncodeSurfaceState<Family>::setFlagsForMediaCompression(R_SURFACE_STATE *su
|
|||
}
|
||||
}
|
||||
template <typename Family>
|
||||
size_t EncodeComputeMode<Family>::getCmdSizeForComputeMode(const HardwareInfo &hwInfo, bool hasSharedHandles, bool isRcs) {
|
||||
size_t EncodeComputeMode<Family>::getCmdSizeForComputeMode(const RootDeviceEnvironment &rootDeviceEnvironment, bool hasSharedHandles, bool isRcs) {
|
||||
return sizeof(typename Family::PIPE_CONTROL) + sizeof(typename Family::MI_LOAD_REGISTER_IMM);
|
||||
}
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ class ProductHelper {
|
|||
virtual void fillScmPropertiesSupportStructure(StateComputeModePropertiesSupport &propertiesSupport) const = 0;
|
||||
virtual void fillFrontEndPropertiesSupportStructure(FrontEndPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const = 0;
|
||||
virtual void fillPipelineSelectPropertiesSupportStructure(PipelineSelectPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const = 0;
|
||||
virtual void fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const = 0;
|
||||
virtual void fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport) const = 0;
|
||||
virtual uint32_t getDefaultRevisionId() const = 0;
|
||||
|
||||
virtual bool isMultiContextResourceDeferDeletionSupported() const = 0;
|
||||
|
@ -330,7 +330,7 @@ class ProductHelperHw : public ProductHelper {
|
|||
void fillScmPropertiesSupportStructure(StateComputeModePropertiesSupport &propertiesSupport) const override;
|
||||
void fillFrontEndPropertiesSupportStructure(FrontEndPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const override;
|
||||
void fillPipelineSelectPropertiesSupportStructure(PipelineSelectPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const override;
|
||||
void fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const override;
|
||||
void fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport) const override;
|
||||
uint32_t getDefaultRevisionId() const override;
|
||||
|
||||
bool isMultiContextResourceDeferDeletionSupported() const override;
|
||||
|
|
|
@ -611,7 +611,7 @@ bool ProductHelperHw<gfxProduct>::getStateBaseAddressPropertyBindingTablePoolBas
|
|||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
void ProductHelperHw<gfxProduct>::fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport, const HardwareInfo &hwInfo) const {
|
||||
void ProductHelperHw<gfxProduct>::fillStateBaseAddressPropertiesSupportStructure(StateBaseAddressPropertiesSupport &propertiesSupport) const {
|
||||
propertiesSupport.globalAtomics = getStateBaseAddressPropertyGlobalAtomicsSupport();
|
||||
propertiesSupport.statelessMocs = getStateBaseAddressPropertyStatelessMocsSupport();
|
||||
propertiesSupport.bindingTablePoolBaseAddress = getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport();
|
||||
|
|
|
@ -277,7 +277,7 @@ TEST(StreamPropertiesTests, givenSingleDispatchCcsFrontEndPropertyWhenSettingPro
|
|||
|
||||
int32_t engineInstancedDevice = 1;
|
||||
|
||||
feProperties.setPropertySingleSliceDispatchCcsMode(engineInstancedDevice, *defaultHwInfo);
|
||||
feProperties.setPropertySingleSliceDispatchCcsMode(engineInstancedDevice, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_TRUE(feProperties.propertiesSupportLoaded);
|
||||
if (fePropertiesSupport.singleSliceDispatchCcsMode) {
|
||||
EXPECT_TRUE(feProperties.singleSliceDispatchCcsMode.isDirty);
|
||||
|
@ -290,7 +290,7 @@ TEST(StreamPropertiesTests, givenSingleDispatchCcsFrontEndPropertyWhenSettingPro
|
|||
feProperties.frontEndPropertiesSupport.singleSliceDispatchCcsMode = true;
|
||||
engineInstancedDevice = 2;
|
||||
|
||||
feProperties.setPropertySingleSliceDispatchCcsMode(engineInstancedDevice, *defaultHwInfo);
|
||||
feProperties.setPropertySingleSliceDispatchCcsMode(engineInstancedDevice, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_TRUE(feProperties.singleSliceDispatchCcsMode.isDirty);
|
||||
EXPECT_EQ(engineInstancedDevice, feProperties.singleSliceDispatchCcsMode.value);
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ TEST(StreamPropertiesTests, whenSettingPipelineSelectPropertiesThenCorrectValueI
|
|||
for (auto modeSelected : ::testing::Bool()) {
|
||||
for (auto mediaSamplerDopClockGate : ::testing::Bool()) {
|
||||
for (auto systolicMode : ::testing::Bool()) {
|
||||
properties.pipelineSelect.setProperties(modeSelected, mediaSamplerDopClockGate, systolicMode, *defaultHwInfo);
|
||||
properties.pipelineSelect.setProperties(modeSelected, mediaSamplerDopClockGate, systolicMode, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
|
||||
if (pipelineSelectPropertiesSupport.modeSelected) {
|
||||
EXPECT_EQ(modeSelected, properties.pipelineSelect.modeSelected.value);
|
||||
|
@ -329,6 +329,7 @@ TEST(StreamPropertiesTests, whenSettingPipelineSelectPropertiesThenCorrectValueI
|
|||
}
|
||||
|
||||
TEST(StreamPropertiesTests, givenModeSelectPipelineSelectPropertyNotSupportedWhenSettingPropertyAndCheckIfDirtyThenExpectCleanState) {
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
MockPipelineSelectProperties pipeProperties{};
|
||||
pipeProperties.propertiesSupportLoaded = true;
|
||||
pipeProperties.pipelineSelectPropertiesSupport.modeSelected = false;
|
||||
|
@ -337,26 +338,27 @@ TEST(StreamPropertiesTests, givenModeSelectPipelineSelectPropertyNotSupportedWhe
|
|||
|
||||
constexpr bool constState = false;
|
||||
bool changingState = false;
|
||||
pipeProperties.setProperties(changingState, constState, constState, *defaultHwInfo);
|
||||
pipeProperties.setProperties(changingState, constState, constState, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
|
||||
// expect dirty as media and systolic changes from initial registered
|
||||
EXPECT_TRUE(pipeProperties.isDirty());
|
||||
|
||||
changingState = !changingState;
|
||||
pipeProperties.setProperties(changingState, constState, constState, *defaultHwInfo);
|
||||
pipeProperties.setProperties(changingState, constState, constState, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
|
||||
// expect clean as changed modeSelected is not supported
|
||||
EXPECT_FALSE(pipeProperties.isDirty());
|
||||
}
|
||||
|
||||
TEST(StreamPropertiesTests, givenStateBaseAddressSupportFlagStateWhenSettingPropertyAndCheckIfDirtyThenExpectCleanStateForNotSupportedAndDirtyForSupported) {
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
MockStateBaseAddressProperties sbaProperties{};
|
||||
sbaProperties.propertiesSupportLoaded = true;
|
||||
sbaProperties.stateBaseAddressPropertiesSupport.globalAtomics = false;
|
||||
sbaProperties.stateBaseAddressPropertiesSupport.statelessMocs = false;
|
||||
sbaProperties.stateBaseAddressPropertiesSupport.bindingTablePoolBaseAddress = false;
|
||||
|
||||
sbaProperties.setProperties(true, 1, 1, -1, -1, -1, -1, -1, -1, *defaultHwInfo);
|
||||
sbaProperties.setProperties(true, 1, 1, -1, -1, -1, -1, -1, -1, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_FALSE(sbaProperties.isDirty());
|
||||
|
||||
EXPECT_EQ(-1, sbaProperties.globalAtomics.value);
|
||||
|
@ -364,7 +366,7 @@ TEST(StreamPropertiesTests, givenStateBaseAddressSupportFlagStateWhenSettingProp
|
|||
EXPECT_EQ(-1, sbaProperties.bindingTablePoolBaseAddress.value);
|
||||
|
||||
sbaProperties.stateBaseAddressPropertiesSupport.globalAtomics = true;
|
||||
sbaProperties.setProperties(true, 1, 0, -1, -1, -1, -1, -1, -1, *defaultHwInfo);
|
||||
sbaProperties.setProperties(true, 1, 0, -1, -1, -1, -1, -1, -1, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_TRUE(sbaProperties.isDirty());
|
||||
EXPECT_TRUE(sbaProperties.globalAtomics.isDirty);
|
||||
EXPECT_FALSE(sbaProperties.statelessMocs.isDirty);
|
||||
|
@ -376,7 +378,7 @@ TEST(StreamPropertiesTests, givenStateBaseAddressSupportFlagStateWhenSettingProp
|
|||
|
||||
sbaProperties.stateBaseAddressPropertiesSupport.globalAtomics = false;
|
||||
sbaProperties.stateBaseAddressPropertiesSupport.statelessMocs = true;
|
||||
sbaProperties.setProperties(false, 1, 1, -1, -1, -1, -1, -1, -1, *defaultHwInfo);
|
||||
sbaProperties.setProperties(false, 1, 1, -1, -1, -1, -1, -1, -1, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_TRUE(sbaProperties.isDirty());
|
||||
EXPECT_FALSE(sbaProperties.globalAtomics.isDirty);
|
||||
EXPECT_TRUE(sbaProperties.statelessMocs.isDirty);
|
||||
|
@ -388,7 +390,7 @@ TEST(StreamPropertiesTests, givenStateBaseAddressSupportFlagStateWhenSettingProp
|
|||
|
||||
sbaProperties.stateBaseAddressPropertiesSupport.statelessMocs = false;
|
||||
sbaProperties.stateBaseAddressPropertiesSupport.bindingTablePoolBaseAddress = true;
|
||||
sbaProperties.setProperties(true, 2, 2, -1, -1, -1, -1, -1, -1, *defaultHwInfo);
|
||||
sbaProperties.setProperties(true, 2, 2, -1, -1, -1, -1, -1, -1, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_TRUE(sbaProperties.isDirty());
|
||||
EXPECT_FALSE(sbaProperties.globalAtomics.isDirty);
|
||||
EXPECT_FALSE(sbaProperties.statelessMocs.isDirty);
|
||||
|
@ -400,10 +402,10 @@ TEST(StreamPropertiesTests, givenStateBaseAddressSupportFlagStateWhenSettingProp
|
|||
|
||||
sbaProperties.stateBaseAddressPropertiesSupport.globalAtomics = true;
|
||||
sbaProperties.stateBaseAddressPropertiesSupport.statelessMocs = true;
|
||||
sbaProperties.setProperties(true, 1, 2, -1, -1, -1, -1, -1, -1, *defaultHwInfo);
|
||||
sbaProperties.setProperties(true, 1, 2, -1, -1, -1, -1, -1, -1, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_FALSE(sbaProperties.isDirty());
|
||||
|
||||
sbaProperties.setProperties(false, 0, 3, -1, -1, -1, -1, -1, -1, *defaultHwInfo);
|
||||
sbaProperties.setProperties(false, 0, 3, -1, -1, -1, -1, -1, -1, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_TRUE(sbaProperties.isDirty());
|
||||
|
||||
EXPECT_EQ(0, sbaProperties.globalAtomics.value);
|
||||
|
@ -427,11 +429,11 @@ TEST(StreamPropertiesTests, givenStateBaseAddressSupportFlagDefaultValueWhenSett
|
|||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<ProductHelper>();
|
||||
StateBaseAddressPropertiesSupport sbaPropertiesSupport = {};
|
||||
productHelper.fillStateBaseAddressPropertiesSupportStructure(sbaPropertiesSupport, *defaultHwInfo);
|
||||
productHelper.fillStateBaseAddressPropertiesSupportStructure(sbaPropertiesSupport);
|
||||
|
||||
StateBaseAddressProperties sbaProperties{};
|
||||
|
||||
sbaProperties.setProperties(true, 2, 3, -1, -1, -1, -1, -1, -1, *defaultHwInfo);
|
||||
sbaProperties.setProperties(true, 2, 3, -1, -1, -1, -1, -1, -1, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
if (sbaPropertiesSupport.globalAtomics) {
|
||||
EXPECT_EQ(1, sbaProperties.globalAtomics.value);
|
||||
} else {
|
||||
|
@ -452,13 +454,14 @@ TEST(StreamPropertiesTests, givenStateBaseAddressSupportFlagDefaultValueWhenSett
|
|||
}
|
||||
|
||||
TEST(StreamPropertiesTests, givenStateBaseAddressCommonBaseAddressAndSizeWhenSettingAddressSizePropertiesThenExpectCorrectDirtyFlagAndStateValue) {
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
MockStateBaseAddressProperties sbaProperties{};
|
||||
sbaProperties.propertiesSupportLoaded = true;
|
||||
sbaProperties.stateBaseAddressPropertiesSupport.globalAtomics = false;
|
||||
sbaProperties.stateBaseAddressPropertiesSupport.statelessMocs = false;
|
||||
sbaProperties.stateBaseAddressPropertiesSupport.bindingTablePoolBaseAddress = false;
|
||||
|
||||
sbaProperties.setProperties(false, -1, -1, 10, -1, -1, -1, -1, -1, *defaultHwInfo);
|
||||
sbaProperties.setProperties(false, -1, -1, 10, -1, -1, -1, -1, -1, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_TRUE(sbaProperties.isDirty());
|
||||
EXPECT_EQ(10, sbaProperties.surfaceStateBaseAddress.value);
|
||||
|
||||
|
@ -469,7 +472,7 @@ TEST(StreamPropertiesTests, givenStateBaseAddressCommonBaseAddressAndSizeWhenSet
|
|||
EXPECT_FALSE(sbaProperties.indirectObjectBaseAddress.isDirty);
|
||||
EXPECT_FALSE(sbaProperties.indirectObjectSize.isDirty);
|
||||
|
||||
sbaProperties.setProperties(false, -1, -1, 10, 20, -1, -1, -1, -1, *defaultHwInfo);
|
||||
sbaProperties.setProperties(false, -1, -1, 10, 20, -1, -1, -1, -1, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_TRUE(sbaProperties.isDirty());
|
||||
EXPECT_EQ(20u, sbaProperties.surfaceStateSize.value);
|
||||
|
||||
|
@ -480,7 +483,7 @@ TEST(StreamPropertiesTests, givenStateBaseAddressCommonBaseAddressAndSizeWhenSet
|
|||
EXPECT_FALSE(sbaProperties.indirectObjectBaseAddress.isDirty);
|
||||
EXPECT_FALSE(sbaProperties.indirectObjectSize.isDirty);
|
||||
|
||||
sbaProperties.setProperties(false, -1, -1, 10, 20, 30, -1, -1, -1, *defaultHwInfo);
|
||||
sbaProperties.setProperties(false, -1, -1, 10, 20, 30, -1, -1, -1, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_TRUE(sbaProperties.isDirty());
|
||||
EXPECT_EQ(30, sbaProperties.dynamicStateBaseAddress.value);
|
||||
|
||||
|
@ -491,7 +494,7 @@ TEST(StreamPropertiesTests, givenStateBaseAddressCommonBaseAddressAndSizeWhenSet
|
|||
EXPECT_FALSE(sbaProperties.indirectObjectBaseAddress.isDirty);
|
||||
EXPECT_FALSE(sbaProperties.indirectObjectSize.isDirty);
|
||||
|
||||
sbaProperties.setProperties(false, -1, -1, 10, 20, 30, 40, -1, -1, *defaultHwInfo);
|
||||
sbaProperties.setProperties(false, -1, -1, 10, 20, 30, 40, -1, -1, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_TRUE(sbaProperties.isDirty());
|
||||
EXPECT_EQ(40u, sbaProperties.dynamicStateSize.value);
|
||||
|
||||
|
@ -502,7 +505,7 @@ TEST(StreamPropertiesTests, givenStateBaseAddressCommonBaseAddressAndSizeWhenSet
|
|||
EXPECT_FALSE(sbaProperties.indirectObjectBaseAddress.isDirty);
|
||||
EXPECT_FALSE(sbaProperties.indirectObjectSize.isDirty);
|
||||
|
||||
sbaProperties.setProperties(false, -1, -1, 10, 20, 30, 40, 50, -1, *defaultHwInfo);
|
||||
sbaProperties.setProperties(false, -1, -1, 10, 20, 30, 40, 50, -1, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_TRUE(sbaProperties.isDirty());
|
||||
EXPECT_EQ(50, sbaProperties.indirectObjectBaseAddress.value);
|
||||
|
||||
|
@ -513,7 +516,7 @@ TEST(StreamPropertiesTests, givenStateBaseAddressCommonBaseAddressAndSizeWhenSet
|
|||
EXPECT_TRUE(sbaProperties.indirectObjectBaseAddress.isDirty);
|
||||
EXPECT_FALSE(sbaProperties.indirectObjectSize.isDirty);
|
||||
|
||||
sbaProperties.setProperties(false, -1, -1, 10, 20, 30, 40, 50, 60, *defaultHwInfo);
|
||||
sbaProperties.setProperties(false, -1, -1, 10, 20, 30, 40, 50, 60, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_TRUE(sbaProperties.isDirty());
|
||||
EXPECT_EQ(60u, sbaProperties.indirectObjectSize.value);
|
||||
|
||||
|
@ -524,6 +527,6 @@ TEST(StreamPropertiesTests, givenStateBaseAddressCommonBaseAddressAndSizeWhenSet
|
|||
EXPECT_FALSE(sbaProperties.indirectObjectBaseAddress.isDirty);
|
||||
EXPECT_TRUE(sbaProperties.indirectObjectSize.isDirty);
|
||||
|
||||
sbaProperties.setProperties(false, -1, -1, 10, 20, 30, 40, 50, 60, *defaultHwInfo);
|
||||
sbaProperties.setProperties(false, -1, -1, 10, 20, 30, 40, 50, 60, *mockExecutionEnvironment.rootDeviceEnvironments[0]);
|
||||
EXPECT_FALSE(sbaProperties.isDirty());
|
||||
}
|
||||
|
|
|
@ -452,7 +452,7 @@ HWTEST2_F(CommandEncodeStatesTest, whenGetCmdSizeForComputeModeThenCorrectValueI
|
|||
if constexpr (TestTraits<gfxCoreFamily>::programComputeModeCommandProgramsNonCoherent) {
|
||||
expectedScmSize += sizeof(MI_LOAD_REGISTER_IMM);
|
||||
}
|
||||
EXPECT_EQ(expectedScmSize, EncodeComputeMode<FamilyType>::getCmdSizeForComputeMode(*defaultHwInfo, false, false));
|
||||
EXPECT_EQ(expectedScmSize, EncodeComputeMode<FamilyType>::getCmdSizeForComputeMode(this->pDevice->getRootDeviceEnvironment(), false, false));
|
||||
|
||||
UltDeviceFactory deviceFactory{1, 0};
|
||||
auto &csr = deviceFactory.rootDevices[0]->getUltCommandStreamReceiver<FamilyType>();
|
||||
|
|
|
@ -525,7 +525,7 @@ HWTEST_F(ProductHelperTest, WhenFillingPipelineSelectPropertiesSupportThenExpect
|
|||
HWTEST_F(ProductHelperTest, WhenFillingStateBaseAddressPropertiesSupportThenExpectUseCorrectGetters) {
|
||||
StateBaseAddressPropertiesSupport stateBaseAddressPropertiesSupport = {};
|
||||
|
||||
productHelper->fillStateBaseAddressPropertiesSupportStructure(stateBaseAddressPropertiesSupport, pInHwInfo);
|
||||
productHelper->fillStateBaseAddressPropertiesSupportStructure(stateBaseAddressPropertiesSupport);
|
||||
EXPECT_EQ(productHelper->getStateBaseAddressPropertyGlobalAtomicsSupport(), stateBaseAddressPropertiesSupport.globalAtomics);
|
||||
EXPECT_EQ(productHelper->getStateBaseAddressPropertyStatelessMocsSupport(), stateBaseAddressPropertiesSupport.statelessMocs);
|
||||
EXPECT_EQ(productHelper->getStateBaseAddressPropertyBindingTablePoolBaseAddressSupport(), stateBaseAddressPropertiesSupport.bindingTablePoolBaseAddress);
|
||||
|
|
Loading…
Reference in New Issue