Skip to content
Snippets Groups Projects
Commit 8ace0803 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Add more finely grained sectioning comments

parent aa8ae0f8
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ import six # noqa
from loopy.diagnostic import LoopyError
# {{{ instruction processing
# {{{ find_instructions
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 = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment