From 8ace08030267280ebb76442c73ae650140f74cb7 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Fri, 27 May 2016 10:14:14 -0500 Subject: [PATCH] Add more finely grained sectioning comments --- loopy/transform/instruction.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/loopy/transform/instruction.py b/loopy/transform/instruction.py index 8b2fa370a..e73e5c33c 100644 --- a/loopy/transform/instruction.py +++ b/loopy/transform/instruction.py @@ -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 = [] -- GitLab