From b2c5e712c4598486eaa0530c1ca7cff1e181ea81 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni Date: Fri, 30 Mar 2018 14:01:23 -0500 Subject: [PATCH] Handling different instruction types in check_functions_are_scoped --- loopy/preprocess.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/loopy/preprocess.py b/loopy/preprocess.py index 812f6d265..0857a5e72 100644 --- a/loopy/preprocess.py +++ b/loopy/preprocess.py @@ -2153,8 +2153,15 @@ def check_functions_are_scoped(kernel): subst_expander = SubstitutionRuleExpander(kernel.substitutions) for insn in kernel.instructions: - unscoped_calls = UnScopedCallCollector()(subst_expander( - insn.expression)) + if isinstance(insn, MultiAssignmentBase): + unscoped_calls = UnScopedCallCollector()(subst_expander( + insn.expression)) + elif isinstance(insn, (CInstruction, _DataObliviousInstruction)): + pass + else: + raise NotImplementedError("check_function_are_scoped not " + "implemented for %s type of instruction." % type(insn)) + if unscoped_calls: raise LoopyError("Unknown function '%s' obtained -- register a function" " or a kernel corresponding to it." % set(unscoped_calls).pop()) -- GitLab