From 442a45041e4c29edfb79fdbd35b58ed42d74f92f Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni <kaushikcfd@gmail.com> Date: Sun, 18 Mar 2018 20:37:24 -0500 Subject: [PATCH] correctly handles unkonwn functions now. --- loopy/kernel/creation.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/loopy/kernel/creation.py b/loopy/kernel/creation.py index 190a80d3b..1343233bf 100644 --- a/loopy/kernel/creation.py +++ b/loopy/kernel/creation.py @@ -1861,6 +1861,9 @@ class FunctionScoper(IdentityMapper): tuple(self.rec(child) for child in expr.parameters)) + # This is an unknown function as of yet, not modifying it. + return IdentityMapper.map_call(self, expr) + def map_call_with_kwargs(self, expr): if expr.function.name in self.function_ids: from pymbolic.primitives import CallWithKwargs @@ -1874,13 +1877,20 @@ class FunctionScoper(IdentityMapper): for key, val in six.iteritems(expr.kw_parameters)) ) + # This is an unknown function as of yet, not modifying it. + return IdentityMapper.map_call(self, expr) + class ScopedFunctionCollector(Collector): + """ This mapper would collect all the instances of :class:`ScopedFunction` + occurring in the expression and written all of them as a :class:`set`. + """ def map_scoped_function(self, expr): return set([expr.name]) - map_sub_array_ref = Collector.map_constant + def map_sub_array_ref(self, expr): + return set() def scope_functions(kernel): -- GitLab