diff --git a/MEMO b/MEMO index 19e54706ddaf37dd845abd595dcee519df7c3280..1866105afda277641eeda021374196fd56416d0c 100644 --- a/MEMO +++ b/MEMO @@ -39,6 +39,16 @@ Things to consider To-do ^^^^^ +- dim_max caching + +- Pick not just axis 0, but all axes by lowest available stride + +- Unidirectional unification + +- Unification Wildcards + +- No looking at the lead domain? + - Fix all tests - Deal with equality constraints. diff --git a/loopy/__init__.py b/loopy/__init__.py index a66b9958f6efc1b9491e2e6d13308ffe34e2ac1f..7fd63dff33fc9693956f6255908bb2684f0ab765 100644 --- a/loopy/__init__.py +++ b/loopy/__init__.py @@ -382,17 +382,22 @@ def tag_dimensions(kernel, iname_to_tag, force=False): iname_to_tag = dict((iname, parse_tag(tag)) for iname, tag in iname_to_tag.iteritems()) - from loopy.kernel import ParallelTag + from loopy.kernel import (ParallelTag, AutoLocalIndexTagBase, + LocalIndexTag) new_iname_to_tag = kernel.iname_to_tag.copy() for iname, new_tag in iname_to_tag.iteritems(): old_tag = kernel.iname_to_tag.get(iname) - if old_tag is not None and new_tag is None: - raise ValueError("cannot untag iname '%s'" % iname) + retag_ok = False + + if (isinstance(old_tag, AutoLocalIndexTagBase) + and (new_tag is None + or isinstance(new_tag, LocalIndexTag))): + retag_ok = True - if new_tag is None: - continue + if not retag_ok and old_tag is not None and new_tag is None: + raise ValueError("cannot untag iname '%s'" % iname) if iname not in kernel.all_inames(): raise ValueError("cannot tag '%s'--not known" % iname) @@ -401,7 +406,7 @@ def tag_dimensions(kernel, iname_to_tag, force=False): raise ValueError("cannot tag '%s' as parallel--" "iname requires sequential execution" % iname) - if (not force) and old_tag is not None and (old_tag != new_tag): + if (not retag_ok) and (not force) and old_tag is not None and (old_tag != new_tag): raise RuntimeError("'%s' is already tagged '%s'--cannot retag" % (iname, old_tag))