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
8ace0803
Commit
8ace0803
authored
8 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Add more finely grained sectioning comments
parent
aa8ae0f8
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/transform/instruction.py
+22
-1
22 additions, 1 deletion
loopy/transform/instruction.py
with
22 additions
and
1 deletion
loopy/transform/instruction.py
+
22
−
1
View file @
8ace0803
...
...
@@ -27,7 +27,7 @@ import six # noqa
from
loopy.diagnostic
import
LoopyError
# {{{ instruction
processing
# {{{
find_
instruction
s
def
find_instructions
(
kernel
,
insn_match
):
from
loopy.match
import
parse_match
...
...
@@ -35,6 +35,11 @@ def find_instructions(kernel, insn_match):
return
[
insn
for
insn
in
kernel
.
instructions
if
match
(
kernel
,
insn
)]
# }}}
# {{{ map_instructions
def
map_instructions
(
kernel
,
insn_match
,
f
):
from
loopy.match
import
parse_match
match
=
parse_match
(
insn_match
)
...
...
@@ -49,6 +54,10 @@ def map_instructions(kernel, insn_match, f):
return
kernel
.
copy
(
instructions
=
new_insns
)
# }}}
# {{{ set_instruction_priority
def
set_instruction_priority
(
kernel
,
insn_match
,
priority
):
"""
Set the priority of instructions matching *insn_match* to *priority*.
...
...
@@ -62,6 +71,10 @@ def set_instruction_priority(kernel, insn_match, priority):
return
map_instructions
(
kernel
,
insn_match
,
set_prio
)
# }}}
# {{{ add_dependency
def
add_dependency
(
kernel
,
insn_match
,
dependency
):
"""
Add the instruction dependency *dependency* to the instructions matched
...
...
@@ -87,6 +100,10 @@ def add_dependency(kernel, insn_match, dependency):
return
map_instructions
(
kernel
,
insn_match
,
add_dep
)
# }}}
# {{{ remove_instructions
def
remove_instructions
(
kernel
,
insn_ids
):
"""
Return a new kernel with instructions in *insn_ids* removed.
...
...
@@ -124,6 +141,10 @@ def remove_instructions(kernel, insn_ids):
return
kernel
.
copy
(
instructions
=
new_insns
)
# }}}
# {{{ replace_instruction_ids
def
replace_instruction_ids
(
kernel
,
replacements
):
new_insns
=
[]
...
...
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