SWDEV-490860 - Do signal_is_required detection post graph schedule
Change-Id: Iaf1067a811aeac3d16c08de954036e219b545e07
Este commit está contenido en:
cometido por
Anusha Godavarthy Surya
padre
0d4823ff88
commit
89dfdc4dbe
@@ -1381,10 +1381,10 @@ hipError_t ihipGraphInstantiate(hip::GraphExec** pGraphExec, hip::Graph* graph,
|
|||||||
return hipErrorInvalidValue;
|
return hipErrorInvalidValue;
|
||||||
}
|
}
|
||||||
std::vector<hip::GraphNode*> graphNodes;
|
std::vector<hip::GraphNode*> graphNodes;
|
||||||
|
clonedGraph->ScheduleNodes();
|
||||||
if (false == clonedGraph->TopologicalOrder(graphNodes)) {
|
if (false == clonedGraph->TopologicalOrder(graphNodes)) {
|
||||||
return hipErrorInvalidValue;
|
return hipErrorInvalidValue;
|
||||||
}
|
}
|
||||||
clonedGraph->ScheduleNodes();
|
|
||||||
*pGraphExec = new hip::GraphExec(graphNodes, clonedGraph, clonedNodes, flags);
|
*pGraphExec = new hip::GraphExec(graphNodes, clonedGraph, clonedNodes, flags);
|
||||||
if (*pGraphExec != nullptr) {
|
if (*pGraphExec != nullptr) {
|
||||||
graph->SetGraphInstantiated(true);
|
graph->SetGraphInstantiated(true);
|
||||||
|
|||||||
@@ -179,13 +179,6 @@ void Graph::ScheduleOneNode(Node node, int stream_id) {
|
|||||||
node->stream_id_ = stream_id;
|
node->stream_id_ = stream_id;
|
||||||
max_streams_ = std::max(max_streams_, (stream_id + 1));
|
max_streams_ = std::max(max_streams_, (stream_id + 1));
|
||||||
|
|
||||||
// Update the dependencies if a signal is required
|
|
||||||
for (auto dep: node->GetDependencies()) {
|
|
||||||
// Check if the stream ID doesn't match and enable signal
|
|
||||||
if (dep->stream_id_ != node->stream_id_) {
|
|
||||||
dep->signal_is_required_ |= true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Process child graph separately, since, there is no connection
|
// Process child graph separately, since, there is no connection
|
||||||
if (node->GetType() == hipGraphNodeTypeGraph) {
|
if (node->GetType() == hipGraphNodeTypeGraph) {
|
||||||
auto child = reinterpret_cast<hip::ChildGraphNode*>(node)->childGraph_;
|
auto child = reinterpret_cast<hip::ChildGraphNode*>(node)->childGraph_;
|
||||||
@@ -236,6 +229,14 @@ bool Graph::TopologicalOrder(std::vector<Node>& TopoOrder) {
|
|||||||
std::queue<Node> q;
|
std::queue<Node> q;
|
||||||
std::unordered_map<Node, int> inDegree;
|
std::unordered_map<Node, int> inDegree;
|
||||||
for (auto entry : vertices_) {
|
for (auto entry : vertices_) {
|
||||||
|
// Update the dependencies if a signal is required
|
||||||
|
for (auto dep: entry->GetDependencies()) {
|
||||||
|
// Check if the stream ID doesn't match and enable signal
|
||||||
|
if (dep->stream_id_ != entry->stream_id_) {
|
||||||
|
dep->signal_is_required_ = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (entry->GetInDegree() == 0) {
|
if (entry->GetInDegree() == 0) {
|
||||||
q.push(entry);
|
q.push(entry);
|
||||||
}
|
}
|
||||||
|
|||||||
Referencia en una nueva incidencia
Block a user