diff --git a/numba/core/typing/context.py b/numba/core/typing/context.py index 720cbbb258e..8860e442fae 100644 --- a/numba/core/typing/context.py +++ b/numba/core/typing/context.py @@ -234,6 +234,14 @@ def _resolve_user_function_type(self, func, args, kws, literals=None): if functy is not None: func = functy + from numba.core.registry import CPUDispatcher + if isinstance(func, CPUDispatcher) and func is not CPUDispatcher: + # if we are here it's numba-dppy case and we got TargetDispatcher, so get compiled version + func = func.get_compiled() + functy = self._lookup_global(func) + if functy is not None: + func = functy + if isinstance(func, types.Type): # If it's a type, it may support a __call__ method func_type = self.resolve_getattr(func, "__call__")