Function
function
P = ParamSpec('P')
module-attribute
R = TypeVar('R')
module-attribute
CFunc
Bases: Protocol
A callable native function pointer.
Source code in xdsl/jit/function.py
12 13 14 15 | |
__call__(*args: Any, **kwargs: Any) -> Any
Source code in xdsl/jit/function.py
15 | |
RawJITFunc
dataclass
A JIT-compiled native function.
Backends may subclass this to retain native runtime state that must outlive
calls through c_func.
Source code in xdsl/jit/function.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
c_func_type: CFuncSignature
instance-attribute
Native function signature.
c_func: CFunc
instance-attribute
Entry point enforcing c_func_type, valid while this object remains alive.
__init__(c_func_type: CFuncSignature, c_func: CFunc) -> None
WrappedJITFunc
dataclass
A Python-callable wrapper around a :class:RawJITFunc.
Applies configured argument and result conversions around the native call.
Source code in xdsl/jit/function.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
raw_func: RawJITFunc
instance-attribute
Underlying native binding.
original_func: Callable[P, R]
instance-attribute
The undecorated Python function.
__call__: Callable[P, R]
instance-attribute
Wrapped call implementation.
__init__(raw_func: RawJITFunc, original_func: Callable[P, R], __call__: Callable[P, R]) -> None
wrap_jit_func(raw_func: RawJITFunc, original_func: Callable[P, R], signature: TypeForm[Callable[P, R]], py_type_context: PyTypeContext) -> WrappedJITFunc[P, R]
Wrap a :class:RawJITFunc as a :class:WrappedJITFunc.
Builds argument/result converters from signature and checks that the
resulting C signature matches raw_func.c_func_type.
Source code in xdsl/jit/function.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |