Signature#

class rbc.remotejit.Signature(remotejit)#

Signature decorator for Python functions.

A Signature decorator may contain many signature objects representing the prototypes of functions.

Signature decorators are re-usable and composeable. For example:

rjit = RemoteJIT(host='localhost' port=6274)

# remotebinaryfunc is Signature instance
remotebinaryfunc = rjit('int32(int32, int32)',
                        'float32(float32, float32)', ...)

# add will be Caller instance
@remotebinaryfunc
def add(a, b):
    return a + b

# sub will be Caller instance
@remotebinaryfunc
def sub(a, b):
    return a - b

add(1, 2) # returns 3
sub(1.0, 2.0) # returns -1.0

Attributes

Methods

Signature.__init__(remotejit)

Signature.add(sig)

Signature.best_match(func, atypes)

Return function type from signatures that matches best with given argument types.

Signature.normalized([func])

Return a copy of Signature object where all signatures are normalized to Type instances using the current target device information.