Skip to content
Snippets Groups Projects
Commit e5205680 authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Don't implicitly expand subst rules as part of type inference

parent a3abcb86
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ THE SOFTWARE.
import six
import numpy as np
from loopy.diagnostic import (
LoopyError, LoopyWarning, WriteRaceConditionWarning, warn,
LoopyError, WriteRaceConditionWarning, warn,
LoopyAdvisory)
from pytools.persistent_dict import PersistentDict
......@@ -139,12 +139,8 @@ def infer_unknown_types(kernel, expect_completion=False):
def debug(s):
logger.debug("%s: %s" % (kernel.name, s))
unexpanded_kernel = kernel
if kernel.substitutions:
from warnings import warn as py_warn
py_warn("type inference called when substitution "
"rules are still unexpanded, expanding",
LoopyWarning, stacklevel=2)
from loopy.subst import expand_subst
kernel = expand_subst(kernel)
......@@ -240,7 +236,7 @@ def infer_unknown_types(kernel, expect_completion=False):
# }}}
return kernel.copy(
return unexpanded_kernel.copy(
temporary_variables=new_temp_vars,
args=[new_arg_dict[arg.name] for arg in kernel.args],
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment