Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loopy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
loopy
Commits
b32bc371
Commit
b32bc371
authored
9 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Improve scheduler debug output
parent
ffca5f0e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loopy/schedule.py
+23
-12
23 additions, 12 deletions
loopy/schedule.py
with
23 additions
and
12 deletions
loopy/schedule.py
+
23
−
12
View file @
b32bc371
...
@@ -322,21 +322,34 @@ def group_insn_counts(kernel):
...
@@ -322,21 +322,34 @@ def group_insn_counts(kernel):
# {{{ debug help
# {{{ debug help
def
dump_schedule
(
schedule
):
def
dump_schedule
(
kernel
,
schedule
):
entries
=
[]
lines
=
[]
indent
=
""
from
loopy.kernel.data
import
ExpressionInstruction
for
sched_item
in
schedule
:
for
sched_item
in
schedule
:
if
isinstance
(
sched_item
,
EnterLoop
):
if
isinstance
(
sched_item
,
EnterLoop
):
entries
.
append
(
"
<%s>
"
%
sched_item
.
iname
)
lines
.
append
(
indent
+
"
LOOP %s
"
%
sched_item
.
iname
)
indent
+=
"
"
elif
isinstance
(
sched_item
,
LeaveLoop
):
elif
isinstance
(
sched_item
,
LeaveLoop
):
entries
.
append
(
"
</%s>
"
%
sched_item
.
iname
)
indent
=
indent
[:
-
4
]
lines
.
append
(
indent
+
"
ENDLOOP %s
"
%
sched_item
.
iname
)
elif
isinstance
(
sched_item
,
RunInstruction
):
elif
isinstance
(
sched_item
,
RunInstruction
):
entries
.
append
(
sched_item
.
insn_id
)
insn
=
kernel
.
id_to_insn
[
sched_item
.
insn_id
]
if
isinstance
(
insn
,
ExpressionInstruction
):
insn_str
=
"
[%s] %s <- %s
"
%
(
insn
.
id
,
str
(
insn
.
assignee
),
str
(
insn
.
expression
))
else
:
insn_str
=
sched_item
.
insn_id
lines
.
append
(
indent
+
insn_str
)
elif
isinstance
(
sched_item
,
Barrier
):
elif
isinstance
(
sched_item
,
Barrier
):
entri
es
.
append
(
"
|
"
)
lin
es
.
append
(
indent
+
"
---BARRIER---
"
)
else
:
else
:
assert
False
assert
False
return
"
"
.
join
(
entries
)
return
"
\n
"
.
join
(
"
% 4d: %s
"
%
(
i
,
line
)
for
i
,
line
in
enumerate
(
lines
))
class
ScheduleDebugger
:
class
ScheduleDebugger
:
...
@@ -478,6 +491,8 @@ def generate_loop_schedules_internal(
...
@@ -478,6 +491,8 @@ def generate_loop_schedules_internal(
else
:
else
:
rec_allow_boost
=
False
rec_allow_boost
=
False
assert
not
allow_boost
active_inames_set
=
frozenset
(
sched_state
.
active_inames
)
active_inames_set
=
frozenset
(
sched_state
.
active_inames
)
# {{{ decide about debug mode
# {{{ decide about debug mode
...
@@ -497,11 +512,7 @@ def generate_loop_schedules_internal(
...
@@ -497,11 +512,7 @@ def generate_loop_schedules_internal(
print
(
kernel
)
print
(
kernel
)
print
(
75
*
"
=
"
)
print
(
75
*
"
=
"
)
print
(
"
CURRENT SCHEDULE:
"
)
print
(
"
CURRENT SCHEDULE:
"
)
print
(
"
%s (length: %d)
"
%
(
print
(
dump_schedule
(
sched_state
.
kernel
,
sched_state
.
schedule
))
dump_schedule
(
sched_state
.
schedule
),
len
(
sched_state
.
schedule
)))
print
(
"
(LEGEND: entry into loop: <iname>, exit from loop: </iname>,
"
"
instructions w/ no delimiters)
"
)
#print("boost allowed:", allow_boost)
#print("boost allowed:", allow_boost)
print
(
75
*
"
=
"
)
print
(
75
*
"
=
"
)
print
(
"
LOOP NEST MAP:
"
)
print
(
"
LOOP NEST MAP:
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment