Node Fusion x4

This commit is contained in:
2023-05-27 15:38:10 +02:00
parent 572b0adf0f
commit 190a4252f8
2 changed files with 10 additions and 5 deletions

View File

@ -1,4 +1,4 @@
# Fuse nodes n1 -> n2 -> n3 together into one node, return the resulting new node
function node_fusion(graph::DAG, n1::ComputeTaskNode, n2::DataTaskNode, n3::ComputeTaskNode)
if !(n1 in graph) || !(n2 in graph) || !(n3 in graph)
error("[Node Fusion] The given nodes are not part of the given graph")
@ -34,7 +34,7 @@ function node_fusion(graph::DAG, n1::ComputeTaskNode, n2::DataTaskNode, n3::Comp
insert_edge(graph, make_edge(new_node, parent))
end
return nothing
return new_node
end
function node_reduction(graph::DAG, n1::Node, n2::Node)