From 6c901bf3bb58d7c4c494cd2a4883fbfa2f3ff2e5 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni Date: Tue, 20 Mar 2018 17:05:22 -0500 Subject: [PATCH] Scalar calls done --- loopy/kernel/function_interface.py | 3 ++- loopy/type_inference.py | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/loopy/kernel/function_interface.py b/loopy/kernel/function_interface.py index 17bd60ff2..f2c24b293 100644 --- a/loopy/kernel/function_interface.py +++ b/loopy/kernel/function_interface.py @@ -275,7 +275,8 @@ class InKernelCallable(ImmutableRecord): its keyword identifier. """ - if self.arg_id_to_dtype: + if self.arg_id_to_dtype is not None: + # specializing an already specialized function. for id, dtype in arg_id_to_dtype.items(): diff --git a/loopy/type_inference.py b/loopy/type_inference.py index b1b1446db..ee4bf38be 100644 --- a/loopy/type_inference.py +++ b/loopy/type_inference.py @@ -120,6 +120,11 @@ class TypeInferenceMapper(CombineMapper): 0 <= len(dtype_set) <= 1 for dtype_set in dtype_sets) + # Can't infer types if one of the dtypes is unknown + for dtype_set in dtype_sets: + if dtype_set == []: + return [] + from pytools import is_single_valued dtypes = [dtype @@ -667,8 +672,7 @@ def infer_unknown_types(kernel, expect_completion=False): #------------------------------------------------------------------------ # KK: - # FIXME: more type scoped function type specialization but needed for the - # specialization of the in kernel callables + # FIXME: # for example if an instruction is : # `[i]:z[i] = a_kernel_function([j]:x[j], [k]: y[k])` # and if the user already provided the types of the args: x, y, z. -- GitLab