Skip to content
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

[lang] Make dynamic indexing compatible with grouped loop indices of struct fors #3218

Merged
merged 4 commits into from
Oct 20, 2021

Conversation

strongoier
Copy link
Contributor

@strongoier strongoier commented Oct 18, 2021

Related issue = #2590, #2637

One of the remaining issues in #2637 is that grouped loop indices of struct fors are exposed to users as ti.Vector however they are (naturally) implemented as individual variables, therefore dynamic indexing cannot work here. My solution is different from the idea in #2637: instead of making members of ti.Vector loopable, I prefer to keep the individual variables and assign them to a ti.Vector so that the user API is not affected and we don't have to re-design the looping mechanism. Furthermore, after we implement complete optimization passes of tensor types in the future, the ti.Vector allocation and assignments here can be eliminated, which leads to the same performance as before.

@netlify
Copy link

netlify bot commented Oct 18, 2021

✔️ Deploy Preview for jovial-fermat-aa59dc ready!

🔨 Explore the source changes: 11e7bc7

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/616d490dcbf5400008254e5f

😎 Browse the preview: https://deploy-preview-3218--jovial-fermat-aa59dc.netlify.app

@strongoier strongoier requested review from k-ye, ailzhang and squarefk and removed request for k-ye October 18, 2021 10:11
@strongoier
Copy link
Contributor Author

/format

Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants