From c9e352488fe7273aec02d711882c49714ddbb026 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 12 Oct 2011 00:26:36 -0400 Subject: [PATCH] Make syntax for explicit loop dependencies. --- MEMO | 20 ++++++++++---------- loopy/__init__.py | 1 - loopy/kernel.py | 40 +++++++++++++++++++++------------------- test/test_matmul.py | 2 +- 4 files changed, 32 insertions(+), 31 deletions(-) diff --git a/MEMO b/MEMO index 281e17845..d7526fd0d 100644 --- a/MEMO +++ b/MEMO @@ -40,11 +40,15 @@ Things to consider - implemented_domain may end up being smaller than requested in cse evaluations--check that! -- Auto tag assignment depends on known work group size - - Depedencies are pointwise for shared loop dimensions and global over non-shared ones (between dependent and ancestor) +- multiple insns could fight over which iname gets local axis 0 + -> complicated optimization problem + +TODO +^^^^ + - Parallel dimension splitting/merging via tags - FIXME: Deal with insns losing a seq iname dep in a CSE realization @@ -53,19 +57,13 @@ Things to consider - Every loop in loopy is opened at most once. -- Syntax to declare insn deps - - reimplement add_prefetch - user interface for dim length prescription -- make syntax for explicit loop dependencies - -- multiple insns could fight over which iname gets local axis 0 - -> complicated optimization problem - - How to determine which variables need to be duplicated for ILP? - -> Only reduction + -> Reduction + -> CSEs? - Slab decomposition for parallel dimensions - implement at the outermost nesting level regardless @@ -79,6 +77,8 @@ Things to consider Dealt with ^^^^^^^^^^ +- make syntax for explicit loop dependencies + - Implement get_problems() - CSE iname duplication might be unnecessary? diff --git a/loopy/__init__.py b/loopy/__init__.py index 6f1c9b930..ce40f0d2b 100644 --- a/loopy/__init__.py +++ b/loopy/__init__.py @@ -30,7 +30,6 @@ from loopy.kernel import ScalarArg, ArrayArg, ImageArg from loopy.kernel import LoopKernel from loopy.schedule import generate_loop_schedules -from loopy.prefetch import insert_register_prefetches from loopy.compiled import CompiledKernel, drive_timing_run # }}} diff --git a/loopy/kernel.py b/loopy/kernel.py index 762a4c4b6..59a9846b1 100644 --- a/loopy/kernel.py +++ b/loopy/kernel.py @@ -402,27 +402,39 @@ class LoopKernel(Record): :arg domain: a :class:`islpy.BasicSet`, or a string parseable to a basic set by the isl. Example: "{[i,j]: 0<=i < 10 and 0<= j < 9}" """ + import re + LABEL_DEP_RE = re.compile( + r"^(?:\{(?P