Skip to content

Commit 32b0f7b

Browse files
Remove redundant value CsrSizeRequestFlags::numGrfRequiredChanged
Related-To: NEO-5995 Signed-off-by: Filip Hazubski <[email protected]>
1 parent adc5fb3 commit 32b0f7b

34 files changed

+72
-207
lines changed

level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::executeCommandListImm
3333
nullptr, //flushStampReference
3434
NEO::QueueThrottle::MEDIUM, //throttle
3535
this->getCommandListPreemptionMode(), //preemptionMode
36-
this->commandContainer.lastSentNumGrfRequired, //numGrfRequired
36+
GrfConfig::NotApplicable, //numGrfRequired
3737
NEO::L3CachingSettings::l3CacheOn, //l3CacheSettings
3838
this->requiredStreamState.stateComputeMode.threadArbitrationPolicy.value, //threadArbitrationPolicy
3939
NEO::AdditionalKernelExecInfo::NotApplicable, //additionalKernelExecInfo

opencl/test/unit_test/gen11/coherency_tests_gen11.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,19 @@ struct Gen11CoherencyRequirements : public ::testing::Test {
4646
GEN11TEST_F(Gen11CoherencyRequirements, GivenSettingsWhenCoherencyRequestedThenProgrammingIsCorrect) {
4747
auto lriSize = sizeof(MI_LOAD_REGISTER_IMM);
4848
overrideCoherencyRequest(false, false);
49-
EXPECT_FALSE(csr->isComputeModeNeeded());
49+
EXPECT_FALSE(csr->streamProperties.stateComputeMode.isDirty());
5050

5151
overrideCoherencyRequest(false, true);
52-
EXPECT_FALSE(csr->isComputeModeNeeded());
52+
EXPECT_FALSE(csr->streamProperties.stateComputeMode.isDirty());
5353

5454
overrideCoherencyRequest(true, true);
5555
auto retSize = csr->getCmdSizeForComputeMode();
56-
EXPECT_TRUE(csr->isComputeModeNeeded());
56+
EXPECT_TRUE(csr->streamProperties.stateComputeMode.isDirty());
5757
EXPECT_EQ(lriSize, retSize);
5858

5959
overrideCoherencyRequest(true, false);
6060
retSize = csr->getCmdSizeForComputeMode();
61-
EXPECT_TRUE(csr->isComputeModeNeeded());
61+
EXPECT_TRUE(csr->streamProperties.stateComputeMode.isDirty());
6262
EXPECT_EQ(lriSize, retSize);
6363
}
6464

opencl/test/unit_test/gen12lp/coherency_tests_gen12lp.inl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,19 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, GivenNoSharedHandlesWhenGettingCmdSi
7272
}
7373

7474
overrideCoherencyRequest(false, false, false);
75-
EXPECT_FALSE(csr->isComputeModeNeeded());
75+
EXPECT_FALSE(csr->streamProperties.stateComputeMode.isDirty());
7676

7777
overrideCoherencyRequest(false, true, false);
78-
EXPECT_FALSE(csr->isComputeModeNeeded());
78+
EXPECT_FALSE(csr->streamProperties.stateComputeMode.isDirty());
7979

8080
overrideCoherencyRequest(true, true, false);
8181
auto retSize = csr->getCmdSizeForComputeMode();
82-
EXPECT_TRUE(csr->isComputeModeNeeded());
82+
EXPECT_TRUE(csr->streamProperties.stateComputeMode.isDirty());
8383
EXPECT_EQ(cmdsSize, retSize);
8484

8585
overrideCoherencyRequest(true, false, false);
8686
retSize = csr->getCmdSizeForComputeMode();
87-
EXPECT_TRUE(csr->isComputeModeNeeded());
87+
EXPECT_TRUE(csr->streamProperties.stateComputeMode.isDirty());
8888
EXPECT_EQ(cmdsSize, retSize);
8989
}
9090

@@ -99,19 +99,19 @@ GEN12LPTEST_F(Gen12LpCoherencyRequirements, GivenSharedHandlesWhenGettingCmdSize
9999
}
100100

101101
overrideCoherencyRequest(false, false, true);
102-
EXPECT_FALSE(csr->isComputeModeNeeded());
102+
EXPECT_FALSE(csr->streamProperties.stateComputeMode.isDirty());
103103

104104
overrideCoherencyRequest(false, true, true);
105-
EXPECT_FALSE(csr->isComputeModeNeeded());
105+
EXPECT_FALSE(csr->streamProperties.stateComputeMode.isDirty());
106106

107107
overrideCoherencyRequest(true, true, true);
108108
auto retSize = csr->getCmdSizeForComputeMode();
109-
EXPECT_TRUE(csr->isComputeModeNeeded());
109+
EXPECT_TRUE(csr->streamProperties.stateComputeMode.isDirty());
110110
EXPECT_EQ(cmdsSize, retSize);
111111

112112
overrideCoherencyRequest(true, false, true);
113113
retSize = csr->getCmdSizeForComputeMode();
114-
EXPECT_TRUE(csr->isComputeModeNeeded());
114+
EXPECT_TRUE(csr->streamProperties.stateComputeMode.isDirty());
115115
EXPECT_EQ(cmdsSize, retSize);
116116
}
117117

shared/source/command_container/cmdcontainer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ void CommandContainer::reset() {
154154

155155
iddBlock = nullptr;
156156
nextIddInBlock = this->getNumIddPerBlock();
157-
lastSentNumGrfRequired = 0;
158157
lastPipelineSelectModeRequired = false;
159158
lastSentUseGlobalAtomics = false;
160159
}

shared/source/command_container/cmdcontainer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ class CommandContainer : public NonCopyableOrMovableClass {
7777

7878
uint32_t slmSize = std::numeric_limits<uint32_t>::max();
7979
uint32_t nextIddInBlock = 0;
80-
uint32_t lastSentNumGrfRequired = 0;
8180
bool lastPipelineSelectModeRequired = false;
8281
bool lastSentUseGlobalAtomics = false;
8382

shared/source/command_stream/command_stream_receiver.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ class CommandStreamReceiver {
384384
std::chrono::microseconds gpuHangCheckPeriod{500'000};
385385
uint32_t lastSentL3Config = 0;
386386
uint32_t latestSentStatelessMocsConfig = 0;
387-
uint32_t lastSentNumGrfRequired = GrfConfig::DefaultGrfNumber;
388387
uint64_t lastSentSliceCount = QueueSliceCount::defaultSliceCount;
389388

390389
uint32_t requiredScratchSize = 0;

shared/source/command_stream/command_stream_receiver_hw.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
7575
size_t getCmdSizeForComputeMode();
7676
MOCKABLE_VIRTUAL bool hasSharedHandles();
7777

78-
bool isComputeModeNeeded() const;
7978
bool isPipelineSelectAlreadyProgrammed() const;
8079
void programComputeMode(LinearStream &csr, DispatchFlags &dispatchFlags, const HardwareInfo &hwInfo);
8180

shared/source/command_stream/command_stream_receiver_hw_base.inl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,6 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
268268
dispatchFlags.pipelineSelectArgs.specialPipelineSelectMode,
269269
hwInfo);
270270

271-
if (dispatchFlags.numGrfRequired == GrfConfig::NotApplicable) {
272-
dispatchFlags.numGrfRequired = lastSentNumGrfRequired;
273-
}
274-
275271
auto requiresCoherency = hwHelper.forceNonGpuCoherencyWA(dispatchFlags.requiresCoherency);
276272
this->streamProperties.stateComputeMode.setProperties(requiresCoherency, dispatchFlags.numGrfRequired,
277273
dispatchFlags.threadArbitrationPolicy, hwInfo);
@@ -281,9 +277,6 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
281277
csrSizeRequestFlags.mediaSamplerConfigChanged = this->lastMediaSamplerConfig != static_cast<int8_t>(dispatchFlags.pipelineSelectArgs.mediaSamplerRequired);
282278
csrSizeRequestFlags.specialPipelineSelectModeChanged = isSpecialPipelineSelectModeChanged;
283279

284-
csrSizeRequestFlags.numGrfRequiredChanged = this->lastSentNumGrfRequired != dispatchFlags.numGrfRequired;
285-
lastSentNumGrfRequired = dispatchFlags.numGrfRequired;
286-
287280
csrSizeRequestFlags.activePartitionsChanged = isProgramActivePartitionConfigRequired();
288281

289282
auto force32BitAllocations = getMemoryManager()->peekForce32BitAllocations();
@@ -809,7 +802,7 @@ size_t CommandStreamReceiverHw<GfxFamily>::getRequiredCmdStreamSize(const Dispat
809802
size += sizeof(typename GfxFamily::MI_BATCH_BUFFER_START);
810803

811804
size += getCmdSizeForL3Config();
812-
if (isComputeModeNeeded()) {
805+
if (this->streamProperties.stateComputeMode.isDirty()) {
813806
size += getCmdSizeForComputeMode();
814807
}
815808
size += getCmdSizeForMediaSampler(dispatchFlags.pipelineSelectArgs.mediaSamplerRequired);
@@ -1373,7 +1366,7 @@ inline MemoryCompressionState CommandStreamReceiverHw<GfxFamily>::getMemoryCompr
13731366
template <typename GfxFamily>
13741367
inline bool CommandStreamReceiverHw<GfxFamily>::isPipelineSelectAlreadyProgrammed() const {
13751368
const auto &hwInfoConfig = *HwInfoConfig::get(peekHwInfo().platform.eProductFamily);
1376-
return isComputeModeNeeded() && hwInfoConfig.is3DPipelineSelectWARequired() && isRcs();
1369+
return this->streamProperties.stateComputeMode.isDirty() && hwInfoConfig.is3DPipelineSelectWARequired() && isRcs();
13771370
}
13781371

13791372
template <typename GfxFamily>

shared/source/command_stream/command_stream_receiver_hw_tgllp_and_later.inl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,18 @@
99
#include "shared/source/command_stream/command_stream_receiver_hw.h"
1010
#include "shared/source/device/device.h"
1111
#include "shared/source/helpers/pipe_control_args.h"
12-
#include "shared/source/helpers/state_compute_mode_helper.h"
1312
#include "shared/source/os_interface/hw_info_config.h"
1413

1514
namespace NEO {
1615
template <typename GfxFamily>
1716
void CommandStreamReceiverHw<GfxFamily>::programComputeMode(LinearStream &stream, DispatchFlags &dispatchFlags, const HardwareInfo &hwInfo) {
18-
if (isComputeModeNeeded()) {
17+
if (this->streamProperties.stateComputeMode.isDirty()) {
1918
EncodeComputeMode<GfxFamily>::programComputeModeCommandWithSynchronization(
2019
stream, this->streamProperties.stateComputeMode, dispatchFlags.pipelineSelectArgs,
2120
hasSharedHandles(), hwInfo, isRcs());
2221
}
2322
}
2423

25-
template <typename GfxFamily>
26-
inline bool CommandStreamReceiverHw<GfxFamily>::isComputeModeNeeded() const {
27-
return StateComputeModeHelper<Family>::isStateComputeModeRequired(csrSizeRequestFlags, false) ||
28-
this->streamProperties.stateComputeMode.isDirty();
29-
}
30-
3124
template <>
3225
inline void CommandStreamReceiverHw<Family>::addPipeControlBeforeStateBaseAddress(LinearStream &commandStream) {
3326
PipeControlArgs args;

shared/source/command_stream/csr_definitions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ struct CsrSizeRequestFlags {
123123
bool preemptionRequestChanged = false;
124124
bool mediaSamplerConfigChanged = false;
125125
bool hasSharedHandles = false;
126-
bool numGrfRequiredChanged = false;
127126
bool specialPipelineSelectModeChanged = false;
128127
bool activePartitionsChanged = false;
129128
};

0 commit comments

Comments
 (0)