diff --git a/loopy/preprocess.py b/loopy/preprocess.py index 812f6d265dabf56441d2d333ab11acc7f43ef8d1..0857a5e721d72183cdfa13bf758333dd1b538952 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())