-
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
Chang API of ti.append and ti.length #5420
Labels
feature request
Suggest an idea on this project
Comments
Features 4 and 6 would be a little hard to implement (considering we need to implement these on GPUs). In the long run, we should consider feature 4, allowing users to allocate fields in kernels. |
lin-hitonami
added a commit
that referenced
this issue
Nov 2, 2022
…#6490) Issue: #5420 ### Brief Summary This PR splits `append` operation of Dynamic SNode to two steps: 1. Allocate the space for the new element, increase the length by one, and return the address (void *) to the first byte of the new element. 2. Use `GetChStmt` to get the pointer of the element (of the right type) from the address returned in step 1, and use `GlobalStoreStmt` to store the value into the address. **This PR breaks Dynamic SNode on Metal** Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
lin-hitonami
added a commit
that referenced
this issue
Nov 4, 2022
Issue: #5420 ### Brief Summary This PR lets `SNodeOpExpression` store `vector<Expr> values` instead of `Expr value`, and enables passing a struct to `ti.append`. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
lin-hitonami
added a commit
that referenced
this issue
Nov 9, 2022
Issue: #5420 ### Brief Summary Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This was referenced Nov 28, 2022
lin-hitonami
added a commit
that referenced
this issue
Nov 28, 2022
Issue: #5420 Just noticed that we forgot to enable getting length of dynamic SNode by `x[i].length()` along with `append` and `deactivate` ### Brief Summary
lin-hitonami
added a commit
that referenced
this issue
Nov 29, 2022
Issue: #5420 ### Brief Summary Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Zhao Liang <[email protected]> Co-authored-by: Olinaaaloompa <[email protected]>
lin-hitonami
added a commit
to lin-hitonami/taichi
that referenced
this issue
Nov 29, 2022
Issue: taichi-dev#5420 Just noticed that we forgot to enable getting length of dynamic SNode by `x[i].length()` along with `append` and `deactivate` ### Brief Summary
lin-hitonami
added a commit
to lin-hitonami/taichi
that referenced
this issue
Nov 29, 2022
Issue: taichi-dev#5420 ### Brief Summary Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Zhao Liang <[email protected]> Co-authored-by: Olinaaaloompa <[email protected]>
lin-hitonami
added a commit
that referenced
this issue
Dec 8, 2022
Issue: #5420 ### Brief Summary ![image](https://user-images.githubusercontent.com/90667349/206149920-7ce87bda-7c1c-4c59-bd38-a877c660d71a.png) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Zhao Liang <[email protected]>
quadpixels
pushed a commit
to quadpixels/taichi
that referenced
this issue
May 13, 2023
…taichi-dev#6490) Issue: taichi-dev#5420 ### Brief Summary This PR splits `append` operation of Dynamic SNode to two steps: 1. Allocate the space for the new element, increase the length by one, and return the address (void *) to the first byte of the new element. 2. Use `GetChStmt` to get the pointer of the element (of the right type) from the address returned in step 1, and use `GlobalStoreStmt` to store the value into the address. **This PR breaks Dynamic SNode on Metal** Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
quadpixels
pushed a commit
to quadpixels/taichi
that referenced
this issue
May 13, 2023
Issue: taichi-dev#5420 ### Brief Summary This PR lets `SNodeOpExpression` store `vector<Expr> values` instead of `Expr value`, and enables passing a struct to `ti.append`. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
quadpixels
pushed a commit
to quadpixels/taichi
that referenced
this issue
May 13, 2023
Issue: taichi-dev#5420 ### Brief Summary Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
quadpixels
pushed a commit
to quadpixels/taichi
that referenced
this issue
May 13, 2023
Issue: taichi-dev#5420 Just noticed that we forgot to enable getting length of dynamic SNode by `x[i].length()` along with `append` and `deactivate` ### Brief Summary
quadpixels
pushed a commit
to quadpixels/taichi
that referenced
this issue
May 13, 2023
Issue: taichi-dev#5420 ### Brief Summary Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Zhao Liang <[email protected]> Co-authored-by: Olinaaaloompa <[email protected]>
quadpixels
pushed a commit
to quadpixels/taichi
that referenced
this issue
May 13, 2023
Issue: taichi-dev#5420 ### Brief Summary ![image](https://user-images.githubusercontent.com/90667349/206149920-7ce87bda-7c1c-4c59-bd38-a877c660d71a.png) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Zhao Liang <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature 1
The current usage of
ti.append
andti.length
are quite confusing. They require the users explicitly query the parent node:Shall we change this behaviour to
x[i].append(j)
?Feature 2
Support appending
struct
to dynamic snodes. (currently only 32-bit data is allowed)Feature 3: auto detect axes
When defining a dynamic snode, one need to explicitly write down the axes:
Shall we automatically detect the first available axes (with least index) and pend the dynamic snode to this axes?
For example in the above code,
ti.k
is the first axes belowti.ij
, hence we can maketi.k
to an optional argument here?Feature 4: dynamically allocating a dynamic snode
something like this:
Feature 5:
Add
pop
method so that it can return the last active item and then deactivate it.Feature 6: slicing
support index slicing so that
q[start: end]
returns a 1D vector field.The text was updated successfully, but these errors were encountered: