diff --git a/loopy/preprocess.py b/loopy/preprocess.py index d088e1216027c53fdb0cf6024da964ddd772ceb4..56579920c094f7d92e3c263a9895b024d6cef01e 100644 --- a/loopy/preprocess.py +++ b/loopy/preprocess.py @@ -144,9 +144,14 @@ def infer_unknown_types(kernel, expect_completion=False): logger.debug(" failure") if failed: - if expect_completion and item.name in failed_names: + if item.name in failed_names: # this item has failed before, give up. - raise RuntimeError("could not determine type of '%s'" % item.name) + if expect_completion: + raise RuntimeError( + "could not determine type of '%s'" % item.name) + else: + # We're done here. + break # remember that this item failed failed_names.add(item.name)