SWDEV-422207 - Fix graph catch tests with graph optimizations(DEBUG_CLR_GRAPH_PACKET_CAPTURE enabled)

Change-Id: I16297e0ddde286bf1798c90f2bf846e69819010d
Этот коммит содержится в:
Anusha GodavarthySurya
2023-12-13 07:11:36 +00:00
коммит произвёл Anusha Godavarthy Surya
родитель fb3dfcf889
Коммит 2bb2446d8f
2 изменённых файлов: 13 добавлений и 9 удалений
+9 -7
Просмотреть файл
@@ -1211,13 +1211,13 @@ hipError_t ihipGraphInstantiate(hip::GraphExec** pGraphExec, hip::Graph* graph,
if (clonedGraph == nullptr) {
return hipErrorInvalidValue;
}
std::vector<std::vector<hip::GraphNode*>> parallelLists;
std::unordered_map<hip::GraphNode*, std::vector<hip::GraphNode*>> nodeWaitLists;
clonedGraph->GetRunList(parallelLists, nodeWaitLists);
std::vector<hip::GraphNode*> graphNodes;
if (false == clonedGraph->TopologicalOrder(graphNodes)) {
return hipErrorInvalidValue;
}
std::vector<std::vector<hip::GraphNode*>> parallelLists;
std::unordered_map<hip::GraphNode*, std::vector<hip::GraphNode*>> nodeWaitLists;
clonedGraph->GetRunList(parallelLists, nodeWaitLists);
*pGraphExec =
new hip::GraphExec(graphNodes, parallelLists, nodeWaitLists, clonedGraph, clonedNodes,
flags);
@@ -1237,10 +1237,12 @@ hipError_t hipGraphInstantiate(hipGraphExec_t* pGraphExec, hipGraph_t graph,
}
hip::GraphExec* ge;
hipError_t status = ihipGraphInstantiate(&ge, reinterpret_cast<hip::Graph*>(graph));
*pGraphExec = reinterpret_cast<hipGraphExec_t>(ge);
if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) {
// For graph nodes capture AQL packets to dispatch them directly during graph launch.
status = ge->CaptureAQLPackets();
if (status == hipSuccess) {
*pGraphExec = reinterpret_cast<hipGraphExec_t>(ge);
if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) {
// For graph nodes capture AQL packets to dispatch them directly during graph launch.
status = ge->CaptureAQLPackets();
}
}
HIP_RETURN(status);
}
+4 -2
Просмотреть файл
@@ -549,8 +549,10 @@ hipError_t GraphExec::Run(hipStream_t stream) {
for (int i = 0; i < topoOrder_.size() - 1; i++) {
if (DEBUG_CLR_GRAPH_PACKET_CAPTURE && topoOrder_[i]->GetType() == hipGraphNodeTypeKernel) {
hip_stream->vdev()->dispatchAqlPacket(topoOrder_[i]->GetAqlPacket(), accumulate);
accumulate->addKernelName(topoOrder_[i]->GetKernelName());
if (topoOrder_[i]->GetEnabled()) {
hip_stream->vdev()->dispatchAqlPacket(topoOrder_[i]->GetAqlPacket(), accumulate);
accumulate->addKernelName(topoOrder_[i]->GetKernelName());
}
} else {
topoOrder_[i]->SetStream(hip_stream, this);
status = topoOrder_[i]->CreateCommand(topoOrder_[i]->GetQueue());