Add clearAllDependencies parameter to obtainNewTimestampPacketNodes

The capability to clear Timestamp packet dependencies from command queue.

Related-To: NEO-2747

Change-Id: Id3812539a47b96e23d0b8b17b9b8f54878ee2ef2
Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir
2019-05-23 13:51:32 +02:00
committed by sys_ocldev
parent 608ec933da
commit 583d4d4c6c
4 changed files with 14 additions and 15 deletions

View File

@@ -551,11 +551,11 @@ void CommandQueue::dispatchAuxTranslation(MultiDispatchInfo &multiDispatchInfo,
multiDispatchInfo.rbegin()->setPipeControlRequired(true);
}
void CommandQueue::obtainNewTimestampPacketNodes(size_t numberOfNodes, TimestampPacketContainer &previousNodes) {
void CommandQueue::obtainNewTimestampPacketNodes(size_t numberOfNodes, TimestampPacketContainer &previousNodes, bool clearAllDependencies) {
auto allocator = getCommandStreamReceiver().getTimestampPacketAllocator();
previousNodes.swapNodes(*timestampPacketContainer);
previousNodes.resolveDependencies(isOOQEnabled() || DebugManager.flags.OmitTimestampPacketDependencies.get());
previousNodes.resolveDependencies(clearAllDependencies);
DEBUG_BREAK_IF(timestampPacketContainer->peekNodes().size() > 0);

View File

@@ -444,7 +444,7 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
MOCKABLE_VIRTUAL void dispatchAuxTranslation(MultiDispatchInfo &multiDispatchInfo, MemObjsForAuxTranslation &memObjsForAuxTranslation,
AuxTranslationDirection auxTranslationDirection);
void obtainNewTimestampPacketNodes(size_t numberOfNodes, TimestampPacketContainer &previousNodes);
void obtainNewTimestampPacketNodes(size_t numberOfNodes, TimestampPacketContainer &previousNodes, bool clearAllDependencies);
void processProperties(const cl_queue_properties *properties);
Context *context = nullptr;

View File

@@ -139,6 +139,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
Kernel *parentKernel = multiDispatchInfo.peekParentKernel();
auto devQueue = this->getContext().getDefaultDeviceQueue();
DeviceQueueHw<GfxFamily> *devQueueHw = castToObject<DeviceQueueHw<GfxFamily>>(devQueue);
auto clearAllDependencies = isOOQEnabled() || DebugManager.flags.OmitTimestampPacketDependencies.get();
TagNode<HwTimeStamps> *hwTimeStamps = nullptr;
@@ -205,11 +206,9 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
if (getCommandStreamReceiver().peekTimestampPacketWriteEnabled()) {
csrDeps.fillFromEventsRequestAndMakeResident(eventsRequest, getCommandStreamReceiver(), CsrDependencies::DependenciesType::OnCsr);
if (!multiDispatchInfo.empty()) {
obtainNewTimestampPacketNodes(estimateTimestampPacketNodesCount(multiDispatchInfo), previousTimestampPacketNodes);
csrDeps.push_back(&previousTimestampPacketNodes);
} else if (isCacheFlushCommand(commandType)) {
obtainNewTimestampPacketNodes(1, previousTimestampPacketNodes);
auto nodesCount = !multiDispatchInfo.empty() ? estimateTimestampPacketNodesCount(multiDispatchInfo) : isCacheFlushCommand(commandType) ? 1u : 0u;
if (nodesCount > 0) {
obtainNewTimestampPacketNodes(nodesCount, previousTimestampPacketNodes, clearAllDependencies);
csrDeps.push_back(&previousTimestampPacketNodes);
}
}