diff --git a/MEMO b/MEMO index 225dfffd985865d135617e890cdbdde8d4cfc102..4b22218b86eb0c727d03e75ce16ef4759c02a146 100644 --- a/MEMO +++ b/MEMO @@ -26,9 +26,6 @@ Things to consider other inames -> Is that reasonable? -- Parallel dimension splitting/merging via tags - -> unnecessary? - - Not using all hw loop dimensions causes an error, as is the case for variant 3 in the rank_one test. @@ -36,7 +33,7 @@ Things to consider - Loopy as a data model for implementing custom rewritings -- We won't generate WAWs barrier-needing dependencies +- We won't generate WAW barrier-needing dependencies from one instruction to itself. To-do @@ -44,9 +41,6 @@ To-do - Automatically generate testing code vs. sequential. -- For forced workgroup sizes: check that at least one iname - maps to them. - - If isl can prove that all operands are positive, may use '/' instead of 'floor_div'. @@ -92,6 +86,9 @@ Future ideas Dealt with ^^^^^^^^^^ +- For forced workgroup sizes: check that at least one iname + maps to them. + - variable shuffle detection -> will need unification diff --git a/loopy/check.py b/loopy/check.py index cb20950bce4d7ef0c099100f3b0f018ca3b46d41..e9ff2425e2c4627dcf75591bdea4e112f1497643 100644 --- a/loopy/check.py +++ b/loopy/check.py @@ -5,7 +5,7 @@ from __future__ import division # {{{ sanity checks run during scheduling -def check_for_unused_hw_axes(kernel): +def check_for_unused_hw_axes_in_insns(kernel): group_size, local_size = kernel.get_grid_sizes_as_exprs() group_axes = set(range(len(group_size))) @@ -144,8 +144,29 @@ def check_for_write_races(kernel): "is/are not referenced in the assignee index" % (insn.id, ",".join(inames_without_write_dep))) +def check_for_orphaned_user_hardware_axes(kernel): + from loopy.kernel import LocalIndexTag + for axis in kernel.local_sizes: + found = False + for tag in kernel.iname_to_tag.itervalues(): + if isinstance(tag, LocalIndexTag) and tag.axis == axis: + found = True + break + + if not found: + raise RuntimeError("user-requested local hardware axis %d " + "has no iname mapped to it" % axis) + # }}} +def run_automatic_checks(kernel): + check_for_orphaned_user_hardware_axes(kernel) + check_for_double_use_of_hw_axes(kernel) + check_for_unused_hw_axes_in_insns(kernel) + check_for_inactive_iname_access(kernel) + check_for_write_races(kernel) + + # {{{ sanity-check for implemented domains of each instruction def check_implemented_domains(kernel, implemented_domains): @@ -210,15 +231,6 @@ def check_implemented_domains(kernel, implemented_domains): # }}} -def run_automatic_checks(kernel): - import loopy.check as chk - - chk.check_for_double_use_of_hw_axes(kernel) - chk.check_for_unused_hw_axes(kernel) - chk.check_for_inactive_iname_access(kernel) - chk.check_for_write_races(kernel) - - # {{{ user-invoked checks def get_problems(kernel, parameters):