diff --git a/loopy/preprocess.py b/loopy/preprocess.py index 0857a5e721d72183cdfa13bf758333dd1b538952..4309f9ae1d2a5419e9b608fc34ceccb4cbe55654 100644 --- a/loopy/preprocess.py +++ b/loopy/preprocess.py @@ -2156,15 +2156,16 @@ def check_functions_are_scoped(kernel): if isinstance(insn, MultiAssignmentBase): unscoped_calls = UnScopedCallCollector()(subst_expander( insn.expression)) + if unscoped_calls: + raise LoopyError("Unknown function '%s' obtained -- register a " + "function or a kernel corresponding to it." % + set(unscoped_calls).pop()) 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()) # }}}