Esempio n. 1
0
    def _register(self):
        from numba.core.typing.templates import (make_intrinsic_template,
                                                 infer_global)

        template = make_intrinsic_template(self, self._defn, self._name)
        infer(template)
        infer_global(self, types.Function(template))
Esempio n. 2
0
 def decorate(overload_func):
     template = make_overload_template(func, overload_func, opts, strict,
                                       inline, prefer_literal)
     infer(template)
     if callable(func):
         infer_global(func, types.Function(template))
     return overload_func
Esempio n. 3
0
    def decorate(typing_func):
        def generic(self):
            return typing_func(self.context)

        name = "%s_CallableTemplate" % (func_name, )
        bases = (CallableTemplate, )
        class_dict = dict(key=func, generic=generic)
        template = type(name, bases, class_dict)
        infer(template)
        if callable(func):
            infer_global(func, types.Function(template))
        return typing_func