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 <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2022-09-26 13:12:04 +00:00
committed by Compute-Runtime-Automation
parent 0d23fa1a98
commit f0888fece2
18 changed files with 72 additions and 63 deletions

View File

@ -67,6 +67,7 @@ struct CommandList : _ze_command_list_handle_t {
CommandType type = Invalid;
};
using CommandsToPatch = StackVec<CommandToPatch, 16>;
using CmdListReturnPoints = StackVec<CmdListReturnPoint, 32>;
virtual ze_result_t close() = 0;
virtual ze_result_t destroy() = 0;
@ -265,7 +266,7 @@ struct CommandList : _ze_command_list_handle_t {
return commandsToPatch;
}
std::vector<CmdListReturnPoint> &getReturnPoints() {
CmdListReturnPoints &getReturnPoints() {
return returnPoints;
}
@ -305,7 +306,7 @@ struct CommandList : _ze_command_list_handle_t {
std::map<const void *, NEO::GraphicsAllocation *> hostPtrMap;
std::vector<NEO::GraphicsAllocation *> ownedPrivateAllocations;
std::vector<NEO::GraphicsAllocation *> patternAllocations;
std::vector<CmdListReturnPoint> returnPoints;
CmdListReturnPoints returnPoints;
NEO::StreamProperties requiredStreamState{};
NEO::StreamProperties finalStreamState{};
@ -320,7 +321,7 @@ struct CommandList : _ze_command_list_handle_t {
bool containsCooperativeKernelsFlag = false;
bool containsStatelessUncachedResource = false;
bool performMemoryPrefetch = false;
bool multiReturnPointCommandList = false;
bool frontEndStateTracking = false;
bool systolicModeSupport = false;
bool pipelineSelectStateTracking = false;
bool stateComputeModeTracking = false;

View File

@ -123,9 +123,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
this->commandListPreemptionMode = device->getDevicePreemptionMode();
this->engineGroupType = engineGroupType;
this->flags = flags;
if (this->multiReturnPointCommandList) {
this->returnPoints.reserve(32);
}
auto &hwInfo = device->getHwInfo();
this->systolicModeSupport = NEO::PreambleHelper<GfxFamily>::isSystolicModeConfigurable(hwInfo);
@ -2352,7 +2350,7 @@ void CommandListCoreFamily<gfxCoreFamily>::updateStreamProperties(Kernel &kernel
NEO::PreambleHelper<GfxFamily>::programVfeState(pVfeState, hwInfo, 0, 0, device->getMaxNumHwThreads(), finalStreamState, nullptr);
commandsToPatch.push_back({pVfeStateAddress, pVfeState, CommandToPatch::FrontEndState});
}
if (this->multiReturnPointCommandList) {
if (this->frontEndStateTracking) {
auto &stream = *commandContainer.getCommandStream();
NEO::EncodeBatchBufferStartOrEnd<GfxFamily>::programBatchBufferEnd(stream);

View File

@ -27,7 +27,7 @@
namespace L0 {
CommandList::CommandList(uint32_t numIddsPerBlock) : commandContainer(numIddsPerBlock) {
multiReturnPointCommandList = L0HwHelper::enableMultiReturnPointCommandList();
frontEndStateTracking = L0HwHelper::enableFrontEndStateTracking();
pipelineSelectStateTracking = L0HwHelper::enablePipelineSelectStateTracking();
stateComputeModeTracking = L0HwHelper::enableStateComputeModeTracking();
}

View File

@ -29,7 +29,7 @@ namespace L0 {
CommandQueueAllocatorFn commandQueueFactory[IGFX_MAX_PRODUCT] = {};
bool CommandQueue::frontEndTrackingEnabled() const {
return NEO::DebugManager.flags.AllowPatchingVfeStateInCommandLists.get() || this->multiReturnPointCommandList;
return NEO::DebugManager.flags.AllowPatchingVfeStateInCommandLists.get() || this->frontEndStateTracking;
}
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
useKmdWaitFunction = !!(overrideUseKmdWaitFunction);
}
multiReturnPointCommandList = L0HwHelper::enableMultiReturnPointCommandList();
frontEndStateTracking = L0HwHelper::enableFrontEndStateTracking();
pipelineSelectStateTracking = L0HwHelper::enablePipelineSelectStateTracking();
stateComputeModeTracking = L0HwHelper::enableStateComputeModeTracking();
}

View File

@ -67,7 +67,7 @@ struct CommandQueue : _ze_command_queue_handle_t {
bool commandQueueDebugCmdsProgrammed = false;
bool isCopyOnlyCommandQueue = false;
bool internalUsage = false;
bool multiReturnPointCommandList = false;
bool frontEndStateTracking = false;
bool pipelineSelectStateTracking = false;
bool stateComputeModeTracking = false;
};

View File

@ -70,6 +70,16 @@ struct CommandQueueHw : public CommandQueueImp {
inline bool isNEODebuggerActive(Device *device);
NEO::StreamProperties cmdListBeginState{};
size_t spaceForResidency = 0;
NEO::PreemptionMode preemptionMode{};
NEO::PreemptionMode statePreemption{};
uint32_t perThreadScratchSpaceSize = 0;
uint32_t perThreadPrivateScratchSize = 0;
int32_t engineInstanced = -1;
UnifiedMemoryControls unifiedMemoryControls{};
bool anyCommandListWithCooperativeKernels = false;
bool anyCommandListWithoutCooperativeKernels = false;
bool anyCommandListRequiresDisabledEUFusion = false;
@ -78,13 +88,6 @@ struct CommandQueueHw : public CommandQueueImp {
bool containsAnyRegularCmdList = false;
bool gsbaStateDirty = false;
bool frontEndStateDirty = false;
size_t spaceForResidency = 0;
NEO::StreamProperties cmdListBeginState{};
NEO::PreemptionMode preemptionMode{};
NEO::PreemptionMode statePreemption{};
uint32_t perThreadScratchSpaceSize = 0;
uint32_t perThreadPrivateScratchSize = 0;
int32_t engineInstanced = -1;
const bool isPreemptionModeInitial{false};
bool isDevicePreemptionModeMidThread{};
bool isDebugEnabled{};
@ -94,7 +97,6 @@ struct CommandQueueHw : public CommandQueueImp {
bool isDirectSubmissionEnabled{};
bool isDispatchTaskCountPostSyncRequired{};
bool hasIndirectAccess{};
UnifiedMemoryControls unifiedMemoryControls;
};
ze_result_t validateCommandListsParams(CommandListExecutionContext &ctx,

View File

@ -391,7 +391,7 @@ size_t CommandQueueHw<gfxCoreFamily>::estimateFrontEndCmdSizeForMultipleCommandL
estimatedSize += singleFrontEndCmdSize;
isFrontEndStateDirty = false;
}
if (this->multiReturnPointCommandList) {
if (this->frontEndStateTracking) {
uint32_t frontEndChanges = commandList->getReturnPointsSize();
estimatedSize += (frontEndChanges * singleFrontEndCmdSize);
estimatedSize += (frontEndChanges * NEO::EncodeBatchBufferStartOrEnd<GfxFamily>::getBatchBufferStartSize());
@ -1164,8 +1164,9 @@ void CommandQueueHw<gfxCoreFamily>::programOneCmdListPipelineSelect(CommandList
csrState.pipelineSelect.setProperties(cmdListRequired.pipelineSelect);
if (!preambleSet || csrState.pipelineSelect.isDirty()) {
bool systolic = csrState.pipelineSelect.systolicMode.value == 1 ? true : false;
NEO::PipelineSelectArgs args = {
!!csrState.pipelineSelect.systolicMode.value,
systolic,
false,
false,
commandList->getSystolicModeSupport()};

View File

@ -15,10 +15,10 @@ L0HwHelper &L0HwHelper::get(GFXCORE_FAMILY gfxCore) {
return *l0HwHelperFactory[gfxCore];
}
bool L0HwHelper::enableMultiReturnPointCommandList() {
bool L0HwHelper::enableFrontEndStateTracking() {
constexpr bool defaultValue = false;
if (NEO::DebugManager.flags.MultiReturnPointCommandList.get() != -1) {
return !!NEO::DebugManager.flags.MultiReturnPointCommandList.get();
if (NEO::DebugManager.flags.EnableFrontEndTracking.get() != -1) {
return !!NEO::DebugManager.flags.EnableFrontEndTracking.get();
}
return defaultValue;
}

View File

@ -30,7 +30,7 @@ struct EventPool;
class L0HwHelper {
public:
static L0HwHelper &get(GFXCORE_FAMILY gfxCore);
static bool enableMultiReturnPointCommandList();
static bool enableFrontEndStateTracking();
static bool enablePipelineSelectStateTracking();
static bool enableStateComputeModeTracking();
virtual void setAdditionalGroupProperty(ze_command_queue_group_properties_t &groupProperty, NEO::EngineGroupT &group) const = 0;

View File

@ -117,7 +117,7 @@ void ModuleMutableCommandListFixture::tearDown() {
}
void MultiReturnCommandListFixture::setUp() {
DebugManager.flags.MultiReturnPointCommandList.set(1);
DebugManager.flags.EnableFrontEndTracking.set(1);
ModuleMutableCommandListFixture::setUp(REVISION_B);
}

View File

@ -54,13 +54,13 @@ struct WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>
using BaseClass::estimateBufferSizeMultiTileBarrier;
using BaseClass::finalStreamState;
using BaseClass::flags;
using BaseClass::frontEndStateTracking;
using BaseClass::getAlignedAllocation;
using BaseClass::getAllocationFromHostPtrMap;
using BaseClass::getHostPtrAlloc;
using BaseClass::hostPtrMap;
using BaseClass::indirectAllocationsAllowed;
using BaseClass::initialize;
using BaseClass::multiReturnPointCommandList;
using BaseClass::partitionCount;
using BaseClass::patternAllocations;
using BaseClass::pipelineSelectStateTracking;
@ -122,8 +122,8 @@ struct WhiteBox<L0::CommandListCoreFamilyImmediate<gfxCoreFamily>>
using BaseClass::commandsToPatch;
using BaseClass::csr;
using BaseClass::finalStreamState;
using BaseClass::frontEndStateTracking;
using BaseClass::isFlushTaskSubmissionEnabled;
using BaseClass::multiReturnPointCommandList;
using BaseClass::partitionCount;
using BaseClass::pipelineSelectStateTracking;
using BaseClass::requiredStreamState;
@ -147,9 +147,9 @@ struct WhiteBox<::L0::CommandList> : public ::L0::CommandListImp {
using BaseClass::commandContainer;
using BaseClass::commandListPreemptionMode;
using BaseClass::csr;
using BaseClass::frontEndStateTracking;
using BaseClass::initialize;
using BaseClass::isFlushTaskSubmissionEnabled;
using BaseClass::multiReturnPointCommandList;
using BaseClass::nonImmediateLogicalStateHelper;
using BaseClass::partitionCount;
using BaseClass::pipelineSelectStateTracking;

View File

@ -33,8 +33,8 @@ struct WhiteBox<::L0::CommandQueue> : public ::L0::CommandQueueImp {
using BaseClass::synchronizeByPollingForTaskCount;
using BaseClass::taskCount;
using CommandQueue::activeSubDevices;
using CommandQueue::frontEndStateTracking;
using CommandQueue::internalUsage;
using CommandQueue::multiReturnPointCommandList;
using CommandQueue::partitionCount;
using CommandQueue::pipelineSelectStateTracking;
using CommandQueue::stateComputeModeTracking;
@ -66,8 +66,8 @@ struct MockCommandQueueHw : public L0::CommandQueueHw<gfxCoreFamily> {
using BaseClass::prepareAndSubmitBatchBuffer;
using BaseClass::printfKernelContainer;
using L0::CommandQueue::activeSubDevices;
using L0::CommandQueue::frontEndStateTracking;
using L0::CommandQueue::internalUsage;
using L0::CommandQueue::multiReturnPointCommandList;
using L0::CommandQueue::partitionCount;
using L0::CommandQueue::pipelineSelectStateTracking;
using L0::CommandQueue::preemptionCmdSyncProgramming;

View File

@ -2001,11 +2001,13 @@ HWTEST2_F(CommandListCreate, givenNullEventWhenAppendEventAfterWalkerThenNothing
EXPECT_EQ(commandList->commandContainer.getCommandStream()->getUsed(), usedBefore);
}
TEST_F(CommandListCreate, givenCreatedCommandListWhenGettingMultiReturnPointFlagThenDefaultValuseIsFalse) {
TEST_F(CommandListCreate, givenCreatedCommandListWhenGettingTrackingFlagsThenDefaultValuseIsFalse) {
ze_result_t returnValue;
std::unique_ptr<L0::ult::CommandList> commandList(whiteboxCast(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)));
ASSERT_NE(nullptr, commandList.get());
EXPECT_FALSE(commandList->multiReturnPointCommandList);
EXPECT_FALSE(commandList->frontEndStateTracking);
EXPECT_FALSE(commandList->pipelineSelectStateTracking);
EXPECT_FALSE(commandList->stateComputeModeTracking);
}
} // namespace ult

View File

@ -558,12 +558,12 @@ HWTEST2_F(CmdlistAppendLaunchKernelTests,
using MultiReturnCommandListTest = Test<MultiReturnCommandListFixture>;
HWTEST2_F(MultiReturnCommandListTest, givenMultiReturnIsUsedWhenPropertyDisableEuFusionSupportedThenExpectReturnPointsAndBbEndProgramming, IsAtLeastSkl) {
HWTEST2_F(MultiReturnCommandListTest, givenFrontEndTrackingIsUsedWhenPropertyDisableEuFusionSupportedThenExpectReturnPointsAndBbEndProgramming, IsAtLeastSkl) {
using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;
NEO::FrontEndPropertiesSupport fePropertiesSupport = {};
NEO::HwInfoConfig::get(productFamily)->fillFrontEndPropertiesSupportStructure(fePropertiesSupport, device->getHwInfo());
EXPECT_TRUE(commandList->multiReturnPointCommandList);
EXPECT_TRUE(commandList->frontEndStateTracking);
auto &cmdStream = *commandList->commandContainer.getCommandStream();
auto &cmdBuffers = commandList->commandContainer.getCmdBufferAllocations();
@ -724,12 +724,12 @@ HWTEST2_F(MultiReturnCommandListTest, givenMultiReturnIsUsedWhenPropertyDisableE
}
}
HWTEST2_F(MultiReturnCommandListTest, givenMultiReturnIsUsedWhenPropertyComputeDispatchAllWalkerSupportedThenExpectReturnPointsAndBbEndProgramming, IsAtLeastSkl) {
HWTEST2_F(MultiReturnCommandListTest, givenFrontEndTrackingIsUsedWhenPropertyComputeDispatchAllWalkerSupportedThenExpectReturnPointsAndBbEndProgramming, IsAtLeastSkl) {
using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;
NEO::FrontEndPropertiesSupport fePropertiesSupport = {};
NEO::HwInfoConfig::get(productFamily)->fillFrontEndPropertiesSupportStructure(fePropertiesSupport, device->getHwInfo());
EXPECT_TRUE(commandList->multiReturnPointCommandList);
EXPECT_TRUE(commandList->frontEndStateTracking);
NEO::DebugManager.flags.AllowMixingRegularAndCooperativeKernels.set(1);
@ -886,7 +886,7 @@ HWTEST2_F(MultiReturnCommandListTest, givenMultiReturnIsUsedWhenPropertyComputeD
}
HWTEST2_F(MultiReturnCommandListTest,
givenMultiReturnCmdListIsExecutedWhenPropertyDisableEuFusionSupportedThenExpectFrontEndProgrammingInCmdQueue, IsAtLeastSkl) {
givenFrontEndTrackingCmdListIsExecutedWhenPropertyDisableEuFusionSupportedThenExpectFrontEndProgrammingInCmdQueue, IsAtLeastSkl) {
using VFE_STATE_TYPE = typename FamilyType::VFE_STATE_TYPE;
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;
@ -894,8 +894,8 @@ HWTEST2_F(MultiReturnCommandListTest,
NEO::FrontEndPropertiesSupport fePropertiesSupport = {};
NEO::HwInfoConfig::get(productFamily)->fillFrontEndPropertiesSupportStructure(fePropertiesSupport, device->getHwInfo());
EXPECT_TRUE(commandList->multiReturnPointCommandList);
EXPECT_TRUE(commandQueue->multiReturnPointCommandList);
EXPECT_TRUE(commandList->frontEndStateTracking);
EXPECT_TRUE(commandQueue->frontEndStateTracking);
auto &cmdListStream = *commandList->commandContainer.getCommandStream();
auto &cmdListBuffers = commandList->commandContainer.getCmdBufferAllocations();
@ -1135,7 +1135,7 @@ HWTEST2_F(MultiReturnCommandListTest,
}
HWTEST2_F(MultiReturnCommandListTest,
givenMultiReturnCmdListIsExecutedWhenPropertyComputeDispatchAllWalkerSupportedThenExpectFrontEndProgrammingInCmdQueue, IsAtLeastSkl) {
givenFrontEndTrackingCmdListIsExecutedWhenPropertyComputeDispatchAllWalkerSupportedThenExpectFrontEndProgrammingInCmdQueue, IsAtLeastSkl) {
using VFE_STATE_TYPE = typename FamilyType::VFE_STATE_TYPE;
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;
@ -1145,8 +1145,8 @@ HWTEST2_F(MultiReturnCommandListTest,
NEO::DebugManager.flags.AllowMixingRegularAndCooperativeKernels.set(1);
EXPECT_TRUE(commandList->multiReturnPointCommandList);
EXPECT_TRUE(commandQueue->multiReturnPointCommandList);
EXPECT_TRUE(commandList->frontEndStateTracking);
EXPECT_TRUE(commandQueue->frontEndStateTracking);
auto &cmdListStream = *commandList->commandContainer.getCommandStream();
auto &cmdListBuffers = commandList->commandContainer.getCmdBufferAllocations();
@ -1389,8 +1389,8 @@ HWTEST2_F(MultiReturnCommandListTest, givenCmdQueueAndImmediateCmdListUseSameCsr
NEO::FrontEndPropertiesSupport fePropertiesSupport = {};
NEO::HwInfoConfig::get(productFamily)->fillFrontEndPropertiesSupportStructure(fePropertiesSupport, device->getHwInfo());
EXPECT_TRUE(commandList->multiReturnPointCommandList);
EXPECT_TRUE(commandListImmediate->multiReturnPointCommandList);
EXPECT_TRUE(commandList->frontEndStateTracking);
EXPECT_TRUE(commandListImmediate->frontEndStateTracking);
auto &regularCmdListStream = *commandList->commandContainer.getCommandStream();
@ -1514,8 +1514,8 @@ HWTEST2_F(MultiReturnCommandListTest, givenCmdQueueAndImmediateCmdListUseSameCsr
NEO::FrontEndPropertiesSupport fePropertiesSupport = {};
NEO::HwInfoConfig::get(productFamily)->fillFrontEndPropertiesSupportStructure(fePropertiesSupport, device->getHwInfo());
EXPECT_TRUE(commandList->multiReturnPointCommandList);
EXPECT_TRUE(commandListImmediate->multiReturnPointCommandList);
EXPECT_TRUE(commandList->frontEndStateTracking);
EXPECT_TRUE(commandListImmediate->frontEndStateTracking);
auto cmdQueueCsr = commandQueue->getCsr();
auto &csrProperties = cmdQueueCsr->getStreamProperties();

View File

@ -1798,7 +1798,7 @@ TEST_F(CommandQueueCreate, givenOverrideCmdQueueSyncModeToSynchronousWhenCommand
commandQueue->destroy();
}
TEST_F(CommandQueueCreate, givenCreatedCommandQueueWhenGettingMultiReturnPointFlagThenDefaultValuseIsFalse) {
TEST_F(CommandQueueCreate, givenCreatedCommandQueueWhenGettingTrackingFlagsThenDefaultValuseIsFalse) {
const ze_command_queue_desc_t desc{};
ze_result_t returnValue;
auto commandQueue = whiteboxCast(CommandQueue::create(productFamily,
@ -1811,7 +1811,9 @@ TEST_F(CommandQueueCreate, givenCreatedCommandQueueWhenGettingMultiReturnPointFl
EXPECT_EQ(returnValue, ZE_RESULT_SUCCESS);
ASSERT_NE(nullptr, commandQueue);
EXPECT_FALSE(commandQueue->multiReturnPointCommandList);
EXPECT_FALSE(commandQueue->frontEndStateTracking);
EXPECT_FALSE(commandQueue->pipelineSelectStateTracking);
EXPECT_FALSE(commandQueue->stateComputeModeTracking);
commandQueue->destroy();
}