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

Merge branch 'check-no-sync-with-attributes' into 'master'

Check no_sync_with attribute in check_insn_attributes()

Closes #55

See merge request !131
parents 91513dcf 5463cdfc
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,12 @@ def check_identifiers_in_subst_rules(knl):
# {{{ sanity checks run pre-scheduling
# FIXME: Replace with an enum. See
# https://gitlab.tiker.net/inducer/loopy/issues/85
VALID_NOSYNC_SCOPES = frozenset(["local", "global", "any"])
def check_insn_attributes(kernel):
all_insn_ids = set(insn.id for insn in kernel.instructions)
......@@ -76,6 +82,19 @@ def check_insn_attributes(kernel):
% (insn.id, ", ".join(
insn.depends_on - all_insn_ids)))
no_sync_with_insn_ids = set(id for id, scope in insn.no_sync_with)
if not no_sync_with_insn_ids <= all_insn_ids:
raise LoopyError("insn '%s' has nosync directive with unknown "
"instruction ids: %s"
% (insn.id,
", ".join(no_sync_with_insn_ids - all_insn_ids)))
no_sync_with_scopes = set(scope for id, scope in insn.no_sync_with)
if not no_sync_with_scopes <= VALID_NOSYNC_SCOPES:
raise LoopyError("insn '%s' has invalid nosync scopes: %s"
% (insn.id,
", ".join(no_sync_with_scopes - VALID_NOSYNC_SCOPES)))
def check_loop_priority_inames_known(kernel):
for prio in kernel.loop_priority:
......
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