You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the only use of ArgStoreStmt is for returning values in a kernel. I personally feel like this is a confusing design (#839 (comment)). I suggest removing this statement and replace it with KernelReturnStmt.
Add KernelReturnStmt
KernelReturnStmt can only work in serial offloaded tasks.
Set return values;
Terminate the kernel. Actually, we should enforce that KernelReturnStmt can only be the final statement of a serial kernel. If we add this restriction, then no need to worry about terminating the kernel.
Benefits
SNode readers can finally use return
We can allow return values of arbitrary kernels, e.g.
Cool! This is so cool because we never use ArgStoreStmt in python-defined kernels. But removing ArgStoreStmt, what if we want multiple return values like the pythonicreturn a, b?
Remove ArgStoreStmt
taichi/taichi/ir/ir.h
Line 985 in f5373b1
Currently the only use of
ArgStoreStmt
is for returning values in a kernel. I personally feel like this is a confusing design (#839 (comment)). I suggest removing this statement and replace it withKernelReturnStmt
.Add KernelReturnStmt
KernelReturnStmt
can only work inserial
offloaded tasks.KernelReturnStmt
can only be the final statement of a serial kernel. If we add this restriction, then no need to worry about terminating the kernel.Benefits
Discussions
The text was updated successfully, but these errors were encountered: