WIP
This commit is contained in:
parent
2a1b161462
commit
dd36d6ef7a
@ -102,6 +102,14 @@ function get_exit_node(graph::DAG)
|
||||
error("The given graph has no exit node! It is either empty or not acyclic!")
|
||||
end
|
||||
|
||||
function can_reduce(graph::DAG, n1::Node, n2::Node)
|
||||
if (n1.task != n2.task)
|
||||
return false
|
||||
end
|
||||
|
||||
return Set(parents(graph, n1)) == Set(parents(graph, n2))
|
||||
end
|
||||
|
||||
# check whether the given graph is connected
|
||||
function is_valid(graph::DAG)
|
||||
nodeQueue = Deque{Node}()
|
||||
|
@ -116,7 +116,7 @@ end
|
||||
# function to generate all possible optmizations on the graph
|
||||
function generate_options(graph::DAG)
|
||||
options = (fusions = Vector{Tuple{ComputeTaskNode, DataTaskNode, ComputeTaskNode}}(),
|
||||
reductions = Vector{Tuple{Node, Node}}(),
|
||||
reductions = Vector{Vector{Node}}(),
|
||||
splits = Vector{Tuple{Node}}())
|
||||
|
||||
# find possible node fusions
|
||||
@ -141,10 +141,8 @@ function generate_options(graph::DAG)
|
||||
end
|
||||
|
||||
# find possible node reductions
|
||||
|
||||
|
||||
# find possible node splits
|
||||
|
||||
|
||||
return options
|
||||
end
|
||||
|
@ -32,4 +32,4 @@ end
|
||||
|
||||
function ==(e1::Edge, e2::Edge)
|
||||
return e1.edge[1][] == e2.edge[1][] && e1.edge[2][] == e2.edge[2][]
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user