forked from M-Labs/artiq
language/core/kernel: support return values
This commit is contained in:
parent
85b4d70ced
commit
5b8f34bae2
|
@ -113,7 +113,8 @@ def kernel(arg):
|
||||||
def real_decorator(k_function):
|
def real_decorator(k_function):
|
||||||
@_wraps(k_function)
|
@_wraps(k_function)
|
||||||
def run_on_core(exp, *k_args, **k_kwargs):
|
def run_on_core(exp, *k_args, **k_kwargs):
|
||||||
getattr(exp, arg).run(k_function, ((exp,) + k_args), k_kwargs)
|
return getattr(exp, arg).run(k_function,
|
||||||
|
((exp,) + k_args), k_kwargs)
|
||||||
run_on_core.k_function_info = _KernelFunctionInfo(
|
run_on_core.k_function_info = _KernelFunctionInfo(
|
||||||
core_name=arg, k_function=k_function)
|
core_name=arg, k_function=k_function)
|
||||||
return run_on_core
|
return run_on_core
|
||||||
|
@ -121,7 +122,7 @@ def kernel(arg):
|
||||||
else:
|
else:
|
||||||
@_wraps(arg)
|
@_wraps(arg)
|
||||||
def run_on_core(exp, *k_args, **k_kwargs):
|
def run_on_core(exp, *k_args, **k_kwargs):
|
||||||
exp.core.run(arg, ((exp,) + k_args), k_kwargs)
|
return exp.core.run(arg, ((exp,) + k_args), k_kwargs)
|
||||||
run_on_core.k_function_info = _KernelFunctionInfo(
|
run_on_core.k_function_info = _KernelFunctionInfo(
|
||||||
core_name="core", k_function=arg)
|
core_name="core", k_function=arg)
|
||||||
return run_on_core
|
return run_on_core
|
||||||
|
|
Loading…
Reference in New Issue