-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Argument pack API #5662
Comments
I think we can approach this in steps. First step is to support basic argpacks without nesting and resource heaps. Second step is to support resource heap, and the third step would be to support nesting and implicit argument templates |
Issue: #5662 ### Brief Summary Some cleanup/refactor before implementation.
related: taichi-dev#5662 We need runtime arg handling to be more modular to prepare for struct args.
related: #5662 We need runtime arg handling to be more modular to prepare for struct args. Will send a few refactor PRs on top of this one.
Issue: taichi-dev#5662 ### Brief Summary Some cleanup/refactor before implementation.
related: taichi-dev#5662 ### Brief Summary
…v#6626) related: taichi-dev#5662 We need runtime arg handling to be more modular to prepare for struct args. Will send a few refactor PRs on top of this one.
Should we mark Argument Pack is completed, ignoring this requirement?
Or keep this issue open? |
Similar to how we currently declare arguments for kernels in Taichi CGraph, we can use something similar for the regular kernel launch (with some additions). This API can be used to simplify kernel arguments and passing of resource for larger production projects, such as a raytracer or a production level PBD simulator.
The idea is that the user can create "argument templates", and "argument packs" that instantiates a template (or construct one implicitly by its content). When launching kernels, the argument templates can be used as the argument type, and the kernel should be able to access its members using subscript or
.member
In addition, we should support cascading argument packs just like structs in C, and we should let the ordinary kernel arguments syntax be an implicit argument pack. This way we get a consistent semantics for all arguments.
Here is an example:
The text was updated successfully, but these errors were encountered: