From 43ed1acc63e7ff1c3fde7e335fb52cee39374923 Mon Sep 17 00:00:00 2001 From: Filip Hazubski Date: Tue, 8 Mar 2022 13:46:04 +0000 Subject: [PATCH] Update StateComputeModeProperties design Related-To: NEO-6728 Signed-off-by: Filip Hazubski --- shared/source/command_stream/CMakeLists.txt | 3 ++- .../definitions/stream_properties.inl | 12 ++++++++++- .../command_stream/stream_properties.cpp | 15 ++++++++++---- .../stream_properties_extra.cpp | 20 +++++++++++++++++++ 4 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 shared/source/command_stream/stream_properties_extra.cpp diff --git a/shared/source/command_stream/CMakeLists.txt b/shared/source/command_stream/CMakeLists.txt index bd2a8a309e..d58ecf653c 100644 --- a/shared/source/command_stream/CMakeLists.txt +++ b/shared/source/command_stream/CMakeLists.txt @@ -47,8 +47,9 @@ set(NEO_CORE_COMMAND_STREAM ${CMAKE_CURRENT_SOURCE_DIR}/scratch_space_controller.h ${CMAKE_CURRENT_SOURCE_DIR}/scratch_space_controller_base.cpp ${CMAKE_CURRENT_SOURCE_DIR}/scratch_space_controller_base.h - ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}stream_properties.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/stream_properties.cpp ${CMAKE_CURRENT_SOURCE_DIR}/stream_properties.h + ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}stream_properties_extra.cpp ${CMAKE_CURRENT_SOURCE_DIR}/stream_property.h ${CMAKE_CURRENT_SOURCE_DIR}/submission_status.h ${CMAKE_CURRENT_SOURCE_DIR}/submissions_aggregator.cpp diff --git a/shared/source/command_stream/definitions/stream_properties.inl b/shared/source/command_stream/definitions/stream_properties.inl index 126fd58b4e..521c69dc65 100644 --- a/shared/source/command_stream/definitions/stream_properties.inl +++ b/shared/source/command_stream/definitions/stream_properties.inl @@ -19,7 +19,14 @@ struct StateComputeModeProperties { void setProperties(bool requiresCoherency, uint32_t numGrfRequired, int32_t threadArbitrationPolicy, const HardwareInfo &hwInfo); void setProperties(const StateComputeModeProperties &properties); bool isDirty() const; + + protected: void clearIsDirty(); + + bool isDirtyExtra() const; + void setPropertiesExtra(); + void setPropertiesExtra(const StateComputeModeProperties &properties); + void clearIsDirtyExtra(); }; struct FrontEndProperties { @@ -28,9 +35,12 @@ 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 HardwareInfo &hwInfo); void setProperties(const FrontEndProperties &properties); bool isDirty() const; + + protected: void clearIsDirty(); }; diff --git a/shared/source/command_stream/stream_properties.cpp b/shared/source/command_stream/stream_properties.cpp index bc41666ba9..8c1caa018a 100644 --- a/shared/source/command_stream/stream_properties.cpp +++ b/shared/source/command_stream/stream_properties.cpp @@ -45,6 +45,8 @@ void StateComputeModeProperties::setProperties(bool requiresCoherency, uint32_t threadArbitrationPolicy = DebugManager.flags.OverrideThreadArbitrationPolicy.get(); } this->threadArbitrationPolicy.set(threadArbitrationPolicy); + + setPropertiesExtra(); } void StateComputeModeProperties::setProperties(const StateComputeModeProperties &properties) { @@ -55,11 +57,13 @@ void StateComputeModeProperties::setProperties(const StateComputeModeProperties zPassAsyncComputeThreadLimit.set(properties.zPassAsyncComputeThreadLimit.value); pixelAsyncComputeThreadLimit.set(properties.pixelAsyncComputeThreadLimit.value); threadArbitrationPolicy.set(properties.threadArbitrationPolicy.value); + + setPropertiesExtra(properties); } bool StateComputeModeProperties::isDirty() const { return isCoherencyRequired.isDirty || largeGrfMode.isDirty || zPassAsyncComputeThreadLimit.isDirty || - pixelAsyncComputeThreadLimit.isDirty || threadArbitrationPolicy.isDirty; + pixelAsyncComputeThreadLimit.isDirty || threadArbitrationPolicy.isDirty || isDirtyExtra(); } void StateComputeModeProperties::clearIsDirty() { @@ -68,10 +72,12 @@ void StateComputeModeProperties::clearIsDirty() { zPassAsyncComputeThreadLimit.isDirty = false; pixelAsyncComputeThreadLimit.isDirty = false; threadArbitrationPolicy.isDirty = false; + + 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 HardwareInfo &hwInfo) { clearIsDirty(); this->computeDispatchAllWalkerEnable.set(isCooperativeKernel); @@ -90,7 +96,8 @@ void FrontEndProperties::setProperties(const FrontEndProperties &properties) { } bool FrontEndProperties::isDirty() const { - return disableOverdispatch.isDirty || disableEUFusion.isDirty || singleSliceDispatchCcsMode.isDirty || computeDispatchAllWalkerEnable.isDirty; + return disableOverdispatch.isDirty || disableEUFusion.isDirty || singleSliceDispatchCcsMode.isDirty || + computeDispatchAllWalkerEnable.isDirty; } void FrontEndProperties::clearIsDirty() { diff --git a/shared/source/command_stream/stream_properties_extra.cpp b/shared/source/command_stream/stream_properties_extra.cpp new file mode 100644 index 0000000000..589a842d04 --- /dev/null +++ b/shared/source/command_stream/stream_properties_extra.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/command_stream/stream_properties.h" + +using namespace NEO; + +void StateComputeModeProperties::setPropertiesExtra() { +} +void StateComputeModeProperties::setPropertiesExtra(const StateComputeModeProperties &properties) { +} +bool StateComputeModeProperties::isDirtyExtra() const { + return false; +} +void StateComputeModeProperties::clearIsDirtyExtra() { +}