diff --git a/loopy/preprocess.py b/loopy/preprocess.py index f6bf6ab88b1b306dea62c74dd713e270a53a0cbc..2ed004e078964dc71cb967512f6a21dbde2fcc6c 100644 --- a/loopy/preprocess.py +++ b/loopy/preprocess.py @@ -2230,12 +2230,15 @@ class ArgDescriptionInferer(CombineMapper): assignee_id_to_descr[-i-1] = ValueArgDescriptor() # gathering all the descriptors - combined_arg_id_to_dtype = {**arg_id_to_descr, **assignee_id_to_descr} + # TODO: I dont like in place updates. Change this to somthing else. + # Perhaps make a function? + combined_arg_id_to_descr = arg_id_to_descr.copy() + combined_arg_id_to_descr.update(assignee_id_to_descr) # specializing the function according to the parameter description new_scoped_function = ( self.kernel.scoped_functions[expr.function.name].with_descrs( - combined_arg_id_to_dtype)) + combined_arg_id_to_descr)) # collecting the descriptors for args, kwargs, assignees return (frozenset(((expr, new_scoped_function), )) | diff --git a/loopy/type_inference.py b/loopy/type_inference.py index 9ffdb983e03359aa80bc1584c118e2b9556dc92f..861e59852e797d74fde11d902f1b2f57b795c1a9 100644 --- a/loopy/type_inference.py +++ b/loopy/type_inference.py @@ -630,6 +630,9 @@ def infer_unknown_types(kernel, expect_completion=False): new_arg_dict[name] = item.copy(dtype=new_dtype) else: raise LoopyError("unexpected item type in type inference") + # TODO: I dont like in place updates. Change this to something + # else. Perhaps add a function for doing this, which does it + # using a bunch of copies? specialized_functions.update(new_specialized_functions) else: debug(" failure")