Skip to content

Commit f0888fe

Browse files
Rename command list tracking debug flag and variables
This change reflects exact nature of debug variable and what is code actually doing Related-To: NEO-7187 Signed-off-by: Zbigniew Zdanowicz <[email protected]>
1 parent 0d23fa1 commit f0888fe

File tree

18 files changed

+71
-62
lines changed

18 files changed

+71
-62
lines changed

level_zero/core/source/cmdlist/cmdlist.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ struct CommandList : _ze_command_list_handle_t {
6767
CommandType type = Invalid;
6868
};
6969
using CommandsToPatch = StackVec<CommandToPatch, 16>;
70+
using CmdListReturnPoints = StackVec<CmdListReturnPoint, 32>;
7071

7172
virtual ze_result_t close() = 0;
7273
virtual ze_result_t destroy() = 0;
@@ -265,7 +266,7 @@ struct CommandList : _ze_command_list_handle_t {
265266
return commandsToPatch;
266267
}
267268

268-
std::vector<CmdListReturnPoint> &getReturnPoints() {
269+
CmdListReturnPoints &getReturnPoints() {
269270
return returnPoints;
270271
}
271272

@@ -305,7 +306,7 @@ struct CommandList : _ze_command_list_handle_t {
305306
std::map<const void *, NEO::GraphicsAllocation *> hostPtrMap;
306307
std::vector<NEO::GraphicsAllocation *> ownedPrivateAllocations;
307308
std::vector<NEO::GraphicsAllocation *> patternAllocations;
308-
std::vector<CmdListReturnPoint> returnPoints;
309+
CmdListReturnPoints returnPoints;
309310

310311
NEO::StreamProperties requiredStreamState{};
311312
NEO::StreamProperties finalStreamState{};
@@ -320,7 +321,7 @@ struct CommandList : _ze_command_list_handle_t {
320321
bool containsCooperativeKernelsFlag = false;
321322
bool containsStatelessUncachedResource = false;
322323
bool performMemoryPrefetch = false;
323-
bool multiReturnPointCommandList = false;
324+
bool frontEndStateTracking = false;
324325
bool systolicModeSupport = false;
325326
bool pipelineSelectStateTracking = false;
326327
bool stateComputeModeTracking = false;

level_zero/core/source/cmdlist/cmdlist_hw.inl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
123123
this->commandListPreemptionMode = device->getDevicePreemptionMode();
124124
this->engineGroupType = engineGroupType;
125125
this->flags = flags;
126-
if (this->multiReturnPointCommandList) {
127-
this->returnPoints.reserve(32);
128-
}
126+
129127
auto &hwInfo = device->getHwInfo();
130128
this->systolicModeSupport = NEO::PreambleHelper<GfxFamily>::isSystolicModeConfigurable(hwInfo);
131129

@@ -2352,7 +2350,7 @@ void CommandListCoreFamily<gfxCoreFamily>::updateStreamProperties(Kernel &kernel
23522350
NEO::PreambleHelper<GfxFamily>::programVfeState(pVfeState, hwInfo, 0, 0, device->getMaxNumHwThreads(), finalStreamState, nullptr);
23532351
commandsToPatch.push_back({pVfeStateAddress, pVfeState, CommandToPatch::FrontEndState});
23542352
}
2355-
if (this->multiReturnPointCommandList) {
2353+
if (this->frontEndStateTracking) {
23562354
auto &stream = *commandContainer.getCommandStream();
23572355
NEO::EncodeBatchBufferStartOrEnd<GfxFamily>::programBatchBufferEnd(stream);
23582356

level_zero/core/source/cmdlist/cmdlist_imp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
namespace L0 {
2828

2929
CommandList::CommandList(uint32_t numIddsPerBlock) : commandContainer(numIddsPerBlock) {
30-
multiReturnPointCommandList = L0HwHelper::enableMultiReturnPointCommandList();
30+
frontEndStateTracking = L0HwHelper::enableFrontEndStateTracking();
3131
pipelineSelectStateTracking = L0HwHelper::enablePipelineSelectStateTracking();
3232
stateComputeModeTracking = L0HwHelper::enableStateComputeModeTracking();
3333
}

level_zero/core/source/cmdqueue/cmdqueue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace L0 {
2929
CommandQueueAllocatorFn commandQueueFactory[IGFX_MAX_PRODUCT] = {};
3030

3131
bool CommandQueue::frontEndTrackingEnabled() const {
32-
return NEO::DebugManager.flags.AllowPatchingVfeStateInCommandLists.get() || this->multiReturnPointCommandList;
32+
return NEO::DebugManager.flags.AllowPatchingVfeStateInCommandLists.get() || this->frontEndStateTracking;
3333
}
3434

3535
CommandQueueImp::CommandQueueImp(Device *device, NEO::CommandStreamReceiver *csr, const ze_command_queue_desc_t *desc)
@@ -44,7 +44,7 @@ CommandQueueImp::CommandQueueImp(Device *device, NEO::CommandStreamReceiver *csr
4444
useKmdWaitFunction = !!(overrideUseKmdWaitFunction);
4545
}
4646

47-
multiReturnPointCommandList = L0HwHelper::enableMultiReturnPointCommandList();
47+
frontEndStateTracking = L0HwHelper::enableFrontEndStateTracking();
4848
pipelineSelectStateTracking = L0HwHelper::enablePipelineSelectStateTracking();
4949
stateComputeModeTracking = L0HwHelper::enableStateComputeModeTracking();
5050
}

level_zero/core/source/cmdqueue/cmdqueue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ struct CommandQueue : _ze_command_queue_handle_t {
6767
bool commandQueueDebugCmdsProgrammed = false;
6868
bool isCopyOnlyCommandQueue = false;
6969
bool internalUsage = false;
70-
bool multiReturnPointCommandList = false;
70+
bool frontEndStateTracking = false;
7171
bool pipelineSelectStateTracking = false;
7272
bool stateComputeModeTracking = false;
7373
};

level_zero/core/source/cmdqueue/cmdqueue_hw.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ struct CommandQueueHw : public CommandQueueImp {
7070

7171
inline bool isNEODebuggerActive(Device *device);
7272

73+
NEO::StreamProperties cmdListBeginState{};
74+
75+
size_t spaceForResidency = 0;
76+
NEO::PreemptionMode preemptionMode{};
77+
NEO::PreemptionMode statePreemption{};
78+
uint32_t perThreadScratchSpaceSize = 0;
79+
uint32_t perThreadPrivateScratchSize = 0;
80+
int32_t engineInstanced = -1;
81+
UnifiedMemoryControls unifiedMemoryControls{};
82+
7383
bool anyCommandListWithCooperativeKernels = false;
7484
bool anyCommandListWithoutCooperativeKernels = false;
7585
bool anyCommandListRequiresDisabledEUFusion = false;
@@ -78,13 +88,6 @@ struct CommandQueueHw : public CommandQueueImp {
7888
bool containsAnyRegularCmdList = false;
7989
bool gsbaStateDirty = false;
8090
bool frontEndStateDirty = false;
81-
size_t spaceForResidency = 0;
82-
NEO::StreamProperties cmdListBeginState{};
83-
NEO::PreemptionMode preemptionMode{};
84-
NEO::PreemptionMode statePreemption{};
85-
uint32_t perThreadScratchSpaceSize = 0;
86-
uint32_t perThreadPrivateScratchSize = 0;
87-
int32_t engineInstanced = -1;
8891
const bool isPreemptionModeInitial{false};
8992
bool isDevicePreemptionModeMidThread{};
9093
bool isDebugEnabled{};
@@ -94,7 +97,6 @@ struct CommandQueueHw : public CommandQueueImp {
9497
bool isDirectSubmissionEnabled{};
9598
bool isDispatchTaskCountPostSyncRequired{};
9699
bool hasIndirectAccess{};
97-
UnifiedMemoryControls unifiedMemoryControls;
98100
};
99101

100102
ze_result_t validateCommandListsParams(CommandListExecutionContext &ctx,

level_zero/core/source/cmdqueue/cmdqueue_hw.inl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ size_t CommandQueueHw<gfxCoreFamily>::estimateFrontEndCmdSizeForMultipleCommandL
391391
estimatedSize += singleFrontEndCmdSize;
392392
isFrontEndStateDirty = false;
393393
}
394-
if (this->multiReturnPointCommandList) {
394+
if (this->frontEndStateTracking) {
395395
uint32_t frontEndChanges = commandList->getReturnPointsSize();
396396
estimatedSize += (frontEndChanges * singleFrontEndCmdSize);
397397
estimatedSize += (frontEndChanges * NEO::EncodeBatchBufferStartOrEnd<GfxFamily>::getBatchBufferStartSize());
@@ -1164,8 +1164,9 @@ void CommandQueueHw<gfxCoreFamily>::programOneCmdListPipelineSelect(CommandList
11641164
csrState.pipelineSelect.setProperties(cmdListRequired.pipelineSelect);
11651165

11661166
if (!preambleSet || csrState.pipelineSelect.isDirty()) {
1167+
bool systolic = csrState.pipelineSelect.systolicMode.value == 1 ? true : false;
11671168
NEO::PipelineSelectArgs args = {
1168-
!!csrState.pipelineSelect.systolicMode.value,
1169+
systolic,
11691170
false,
11701171
false,
11711172
commandList->getSystolicModeSupport()};

level_zero/core/source/hw_helpers/l0_hw_helper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ L0HwHelper &L0HwHelper::get(GFXCORE_FAMILY gfxCore) {
1515
return *l0HwHelperFactory[gfxCore];
1616
}
1717

18-
bool L0HwHelper::enableMultiReturnPointCommandList() {
18+
bool L0HwHelper::enableFrontEndStateTracking() {
1919
constexpr bool defaultValue = false;
20-
if (NEO::DebugManager.flags.MultiReturnPointCommandList.get() != -1) {
21-
return !!NEO::DebugManager.flags.MultiReturnPointCommandList.get();
20+
if (NEO::DebugManager.flags.EnableFrontEndTracking.get() != -1) {
21+
return !!NEO::DebugManager.flags.EnableFrontEndTracking.get();
2222
}
2323
return defaultValue;
2424
}

level_zero/core/source/hw_helpers/l0_hw_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct EventPool;
3030
class L0HwHelper {
3131
public:
3232
static L0HwHelper &get(GFXCORE_FAMILY gfxCore);
33-
static bool enableMultiReturnPointCommandList();
33+
static bool enableFrontEndStateTracking();
3434
static bool enablePipelineSelectStateTracking();
3535
static bool enableStateComputeModeTracking();
3636
virtual void setAdditionalGroupProperty(ze_command_queue_group_properties_t &groupProperty, NEO::EngineGroupT &group) const = 0;

level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void ModuleMutableCommandListFixture::tearDown() {
117117
}
118118

119119
void MultiReturnCommandListFixture::setUp() {
120-
DebugManager.flags.MultiReturnPointCommandList.set(1);
120+
DebugManager.flags.EnableFrontEndTracking.set(1);
121121
ModuleMutableCommandListFixture::setUp(REVISION_B);
122122
}
123123

0 commit comments

Comments
 (0)