refactor: don't use global ProductHelper getter 3/n
Related-To: NEO-6853 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
parent
eb63f36108
commit
bd6b7d75f0
|
@ -2347,7 +2347,7 @@ void CommandListCoreFamily<gfxCoreFamily>::updateStreamProperties(Kernel &kernel
|
|||
|
||||
auto &kernelAttributes = kernel.getKernelDescriptor().kernelAttributes;
|
||||
if (!containsAnyKernel) {
|
||||
requiredStreamState.frontEndState.setProperties(isCooperative, kernelAttributes.flags.requiresDisabledEUFusion, true, -1, hwInfo);
|
||||
requiredStreamState.frontEndState.setProperties(isCooperative, kernelAttributes.flags.requiresDisabledEUFusion, true, -1, rootDeviceEnvironment);
|
||||
requiredStreamState.pipelineSelect.setProperties(true, false, kernelAttributes.flags.usesSystolicPipelineSelectMode, hwInfo);
|
||||
if (this->stateComputeModeTracking) {
|
||||
requiredStreamState.stateComputeMode.setProperties(false, kernelAttributes.numGrfRequired, kernelAttributes.threadArbitrationPolicy, device->getDevicePreemptionMode(), rootDeviceEnvironment);
|
||||
|
@ -2372,7 +2372,7 @@ void CommandListCoreFamily<gfxCoreFamily>::updateStreamProperties(Kernel &kernel
|
|||
hwInfo);
|
||||
}
|
||||
|
||||
finalStreamState.frontEndState.setProperties(isCooperative, kernelAttributes.flags.requiresDisabledEUFusion, true, -1, hwInfo);
|
||||
finalStreamState.frontEndState.setProperties(isCooperative, kernelAttributes.flags.requiresDisabledEUFusion, true, -1, rootDeviceEnvironment);
|
||||
bool isPatchingVfeStateAllowed = NEO::DebugManager.flags.AllowPatchingVfeStateInCommandLists.get();
|
||||
if (finalStreamState.frontEndState.isDirty() && logicalStateHelperBlock) {
|
||||
if (isPatchingVfeStateAllowed) {
|
||||
|
|
|
@ -628,13 +628,12 @@ size_t CommandQueueHw<gfxCoreFamily>::estimateLinearStreamSizeInitial(
|
|||
|
||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||
void CommandQueueHw<gfxCoreFamily>::setFrontEndStateProperties(CommandListExecutionContext &ctx) {
|
||||
const auto &hwInfo = this->device->getHwInfo();
|
||||
|
||||
auto isEngineInstanced = csr->getOsContext().isEngineInstanced();
|
||||
auto &streamProperties = this->csr->getStreamProperties();
|
||||
if (!frontEndTrackingEnabled()) {
|
||||
streamProperties.frontEndState.setProperties(ctx.anyCommandListWithCooperativeKernels, ctx.anyCommandListRequiresDisabledEUFusion,
|
||||
true, isEngineInstanced, hwInfo);
|
||||
true, isEngineInstanced, this->device->getNEODevice()->getRootDeviceEnvironment());
|
||||
ctx.frontEndStateDirty |= (streamProperties.frontEndState.isDirty() && !this->csr->getLogicalStateHelper());
|
||||
} else {
|
||||
ctx.engineInstanced = isEngineInstanced;
|
||||
|
|
|
@ -156,7 +156,7 @@ struct UltCommandStreamReceiverTest
|
|||
commandStreamReceiver.streamProperties.pipelineSelect.setProperties(true, false, false, *defaultHwInfo);
|
||||
commandStreamReceiver.streamProperties.stateComputeMode.setProperties(0, GrfConfig::DefaultGrfNumber,
|
||||
gfxCoreHelper.getDefaultThreadArbitrationPolicy(), pDevice->getPreemptionMode(), pDevice->getRootDeviceEnvironment());
|
||||
commandStreamReceiver.streamProperties.frontEndState.setProperties(false, false, false, -1, *defaultHwInfo);
|
||||
commandStreamReceiver.streamProperties.frontEndState.setProperties(false, false, false, -1, pDevice->getRootDeviceEnvironment());
|
||||
|
||||
auto logicalStateHelper = commandStreamReceiver.getLogicalStateHelper();
|
||||
|
||||
|
|
|
@ -324,7 +324,7 @@ HWTEST2_F(PreambleCfeState, givenXehpAndDisabledFusedEuWhenCfeStateProgrammedThe
|
|||
|
||||
auto pVfeCmd = PreambleHelper<FamilyType>::getSpaceForVfeState(&linearStream, hwInfo, EngineGroupType::RenderCompute);
|
||||
StreamProperties streamProperties{};
|
||||
streamProperties.frontEndState.setProperties(false, false, false, false, hwInfo);
|
||||
streamProperties.frontEndState.setProperties(false, false, false, false, rootDeviceEnvironment);
|
||||
PreambleHelper<FamilyType>::programVfeState(pVfeCmd, rootDeviceEnvironment, 0u, 0, 0, streamProperties, nullptr);
|
||||
parseCommands<FamilyType>(linearStream);
|
||||
auto cfeStateIt = find<CFE_STATE *>(cmdList.begin(), cmdList.end());
|
||||
|
@ -346,7 +346,7 @@ HWTEST2_F(PreambleCfeState, givenXehpEnabledFusedEuAndDisableFusedDispatchFromKe
|
|||
|
||||
auto pVfeCmd = PreambleHelper<FamilyType>::getSpaceForVfeState(&linearStream, hwInfo, EngineGroupType::RenderCompute);
|
||||
StreamProperties streamProperties{};
|
||||
streamProperties.frontEndState.setProperties(false, true, false, false, hwInfo);
|
||||
streamProperties.frontEndState.setProperties(false, true, false, false, rootDeviceEnvironment);
|
||||
PreambleHelper<FamilyType>::programVfeState(pVfeCmd, rootDeviceEnvironment, 0u, 0, 0, streamProperties, nullptr);
|
||||
parseCommands<FamilyType>(linearStream);
|
||||
auto cfeStateIt = find<CFE_STATE *>(cmdList.begin(), cmdList.end());
|
||||
|
@ -365,7 +365,7 @@ HWTEST2_F(PreambleCfeState, givenXehpAndEnabledFusedEuWhenCfeStateProgrammedThen
|
|||
|
||||
auto pVfeCmd = PreambleHelper<FamilyType>::getSpaceForVfeState(&linearStream, hwInfo, EngineGroupType::RenderCompute);
|
||||
StreamProperties streamProperties{};
|
||||
streamProperties.frontEndState.setProperties(false, false, false, false, hwInfo);
|
||||
streamProperties.frontEndState.setProperties(false, false, false, false, rootDeviceEnvironment);
|
||||
PreambleHelper<FamilyType>::programVfeState(pVfeCmd, rootDeviceEnvironment, 0u, 0, 0, streamProperties, nullptr);
|
||||
parseCommands<FamilyType>(linearStream);
|
||||
auto cfeStateIt = find<CFE_STATE *>(cmdList.begin(), cmdList.end());
|
||||
|
|
|
@ -1081,7 +1081,7 @@ inline void CommandStreamReceiverHw<GfxFamily>::programVFEState(LinearStream &cs
|
|||
|
||||
auto isCooperative = dispatchFlags.kernelExecutionType == KernelExecutionType::Concurrent;
|
||||
auto disableOverdispatch = (dispatchFlags.additionalKernelExecInfo != AdditionalKernelExecInfo::NotSet);
|
||||
streamProperties.frontEndState.setProperties(isCooperative, dispatchFlags.disableEUFusion, disableOverdispatch, osContext->isEngineInstanced(), hwInfo);
|
||||
streamProperties.frontEndState.setProperties(isCooperative, dispatchFlags.disableEUFusion, disableOverdispatch, osContext->isEngineInstanced(), peekRootDeviceEnvironment());
|
||||
|
||||
auto &gfxCoreHelper = getGfxCoreHelper();
|
||||
auto engineGroupType = gfxCoreHelper.getEngineGroupType(getOsContext().getEngineType(), getOsContext().getEngineUsage(), hwInfo);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -58,7 +58,7 @@ struct FrontEndProperties {
|
|||
StreamProperty disableOverdispatch{};
|
||||
StreamProperty singleSliceDispatchCcsMode{};
|
||||
|
||||
void setProperties(bool isCooperativeKernel, bool disableEUFusion, bool disableOverdispatch, int32_t engineInstancedDevice, const HardwareInfo &hwInfo);
|
||||
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);
|
||||
bool isDirty() const;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -104,9 +104,11 @@ void StateComputeModeProperties::clearIsDirty() {
|
|||
clearIsDirtyExtra();
|
||||
}
|
||||
|
||||
void FrontEndProperties::setProperties(bool isCooperativeKernel, bool disableEUFusion, bool disableOverdispatch, int32_t engineInstancedDevice, const HardwareInfo &hwInfo) {
|
||||
void FrontEndProperties::setProperties(bool isCooperativeKernel, bool disableEUFusion, bool disableOverdispatch, 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;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ TEST(StreamPropertiesTests, whenSettingCooperativeKernelPropertiesThenCorrectVal
|
|||
for (auto isCooperativeKernel : ::testing::Bool()) {
|
||||
for (auto disableOverdispatch : ::testing::Bool()) {
|
||||
for (auto disableEUFusion : ::testing::Bool()) {
|
||||
properties.frontEndState.setProperties(isCooperativeKernel, disableEUFusion, disableOverdispatch, isEngineInstanced, *defaultHwInfo);
|
||||
properties.frontEndState.setProperties(isCooperativeKernel, disableEUFusion, disableOverdispatch, isEngineInstanced, rootDeviceEnvironment);
|
||||
if (frontEndPropertiesSupport.computeDispatchAllWalker) {
|
||||
EXPECT_EQ(isCooperativeKernel, properties.frontEndState.computeDispatchAllWalkerEnable.value);
|
||||
} else {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -31,7 +31,7 @@ PVCTEST_F(PreambleCfeState, givenXeHpcAndKernelExecutionTypeAndRevisionWhenCalli
|
|||
for (const auto &[revision, kernelExecutionType] : revisions) {
|
||||
StreamProperties streamProperties{};
|
||||
hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(revision, *hwInfo);
|
||||
streamProperties.frontEndState.setProperties(kernelExecutionType, false, false, false, *hwInfo);
|
||||
streamProperties.frontEndState.setProperties(kernelExecutionType, false, false, false, pDevice->getRootDeviceEnvironment());
|
||||
|
||||
PreambleHelper<FamilyType>::programVfeState(pVfeCmd, pDevice->getRootDeviceEnvironment(), 0u, 0, 0, streamProperties, nullptr);
|
||||
parseCommands<FamilyType>(linearStream);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -47,7 +47,7 @@ XE_HPC_CORETEST_F(PreambleCfeState, givenKernelExecutionTypeConcurrentAndRevisio
|
|||
|
||||
auto pVfeCmd = PreambleHelper<FamilyType>::getSpaceForVfeState(&linearStream, hwInfo, EngineGroupType::RenderCompute);
|
||||
StreamProperties streamProperties{};
|
||||
streamProperties.frontEndState.setProperties(true, false, false, false, hwInfo);
|
||||
streamProperties.frontEndState.setProperties(true, false, false, false, pDevice->getRootDeviceEnvironment());
|
||||
|
||||
PreambleHelper<FamilyType>::programVfeState(pVfeCmd, pDevice->getRootDeviceEnvironment(), 0u, 0, 0, streamProperties, nullptr);
|
||||
parseCommands<FamilyType>(linearStream);
|
||||
|
|
Loading…
Reference in New Issue