mirror of
https://github.com/RRZE-HPC/OSACA.git
synced 2026-01-04 18:20:09 +01:00
Readying.
This commit is contained in:
@@ -82,9 +82,8 @@ class KernelDG(nx.DiGraph):
|
||||
:type flag_dependencies: boolean, optional
|
||||
:returns: :class:`~nx.DiGraph` -- directed graph object
|
||||
"""
|
||||
# 1. go through kernel instruction forms and add them as node attribute
|
||||
# 2. find edges (to dependend further instruction)
|
||||
# 3. get LT value and set as edge weight
|
||||
# Go through kernel instruction forms and add them as nodes of the graph. Create a LOAD
|
||||
# node for instructions that include a memory reference.
|
||||
dg = nx.DiGraph()
|
||||
loads = {}
|
||||
for i, instruction_form in enumerate(kernel):
|
||||
@@ -110,11 +109,14 @@ class KernelDG(nx.DiGraph):
|
||||
instruction_form.line_number,
|
||||
latency=instruction_form.latency - instruction_form.latency_wo_load,
|
||||
)
|
||||
#TODO comments
|
||||
|
||||
# 1. find edges (to dependend further instruction)
|
||||
# 2. get LT value and set as edge weight
|
||||
for i, instruction_form in enumerate(kernel):
|
||||
for dep, dep_flags in self.find_depending(
|
||||
instruction_form, kernel[i + 1 :], flag_dependencies
|
||||
):
|
||||
# print(instruction_form.line_number,"\t",dep.line_number,"\n")
|
||||
edge_weight = (
|
||||
instruction_form.latency
|
||||
if "mem_dep" in dep_flags or instruction_form.latency_wo_load is None
|
||||
|
||||
Reference in New Issue
Block a user