nac3/nac3embedded/language.py

20 lines
364 B
Python
Raw Normal View History

2020-12-18 23:44:45 +08:00
from functools import wraps
import nac3embedded
__all__ = ["kernel", "portable"]
def kernel(function):
@wraps(function)
def run_on_core(self, *args, **kwargs):
2020-12-19 15:29:39 +08:00
nac3 = nac3embedded.NAC3()
nac3.register_host_object(self)
nac3.compile_method(self, function.__name__)
2020-12-18 23:44:45 +08:00
return run_on_core
def portable(function):
return fn