diff --git a/loopy/kernel/creation.py b/loopy/kernel/creation.py index d81b1f895a19417f32a428c7ba0bc67696abe310..14b18150f5b84218f39ba23662eb6106ffb596a0 100644 --- a/loopy/kernel/creation.py +++ b/loopy/kernel/creation.py @@ -1642,11 +1642,11 @@ def _resolve_dependencies(knl, insn, deps): new_deps.append(other_insn.id) found_any = True - if not found_any: + if not found_any and knl.options.check_dep_resolution: raise LoopyError("instruction '%s' declared a depency on '%s', " "which did not resolve to any instruction present in the " - "kernel '%s'" - % (insn.id, dep, knl.name)) + "kernel '%s'. Set the kernel option 'check_dep_resolution'" + "to False to disable this check." % (insn.id, dep, knl.name)) for dep_id in new_deps: if dep_id not in knl.id_to_insn: diff --git a/loopy/options.py b/loopy/options.py index 7c778681dced904b31e0cc39cff529b8c026640d..25bb7014ce07a30c49f7f78d5a6325eaba36291d 100644 --- a/loopy/options.py +++ b/loopy/options.py @@ -95,6 +95,11 @@ class Options(ImmutableRecord): determining whether an iname duplication is necessary for the kernel to be schedulable. + .. attribute:: check_dep_resolution + + Whether loopy should issue an error if a dependency + expression does not match any instructions in the kernel. + .. rubric:: Invocation-related options .. attribute:: skip_arg_checks @@ -200,6 +205,7 @@ class Options(ImmutableRecord): allow_terminal_colors_def), disable_global_barriers=kwargs.get("disable_global_barriers", False), + check_dep_resolution=kwargs.get("check_dep_resolution", True), ) # {{{ legacy compatibility