|
@@ -389,7 +389,7 @@ class ModelverseKernel(object):
|
|
|
printed = prev + printed
|
|
|
print("Total printed function: ")
|
|
|
if params:
|
|
|
- func = "def " + suggested_name + "(" + ", ".join(["var_%s" % param for param in params]) + ", **kwargs):\n" + printed
|
|
|
+ func = "def " + suggested_name + "(" + ", ".join([chr(ord('a') + i) for i in range(len(params))]) + ", **kwargs):\n" + "".join([" var_%s = %s\n" % (param, chr(ord('a') + i)) for i, param in enumerate(params)]) + printed
|
|
|
else:
|
|
|
func = "def " + suggested_name + "(**kwargs):\n" + printed
|
|
|
print(func)
|
|
@@ -445,6 +445,7 @@ class ModelverseKernel(object):
|
|
|
# Have the JIT compile the function.
|
|
|
compiled_func, = yield [("CALL_ARGS", [self.jit_compile, (task_root, inst)])]
|
|
|
# Run the compiled function.
|
|
|
+ print("Calling function %s with parameters: " % str(compiled_func) + str(parameters))
|
|
|
results = yield [("CALL_KWARGS", [compiled_func, parameters])]
|
|
|
if results is None:
|
|
|
raise Exception("%s: primitive finished without returning a value!" % (self.debug_info[taskname]))
|
|
@@ -461,7 +462,6 @@ class ModelverseKernel(object):
|
|
|
#if self.debug_info[self.taskname]:
|
|
|
# self.debug_info[self.taskname].pop()
|
|
|
|
|
|
- print("Exception return: " + str(exception_return))
|
|
|
if exception_return is not None:
|
|
|
# The caller has requested that we throw an exception instead of injecting
|
|
|
# the return value into the caller's frame. Read the comment at
|