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] Enable dynamic indexing of matrix field elements when possible #3865

Merged
merged 2 commits into from
Dec 27, 2021

Conversation

strongoier
Copy link
Contributor

@strongoier strongoier commented Dec 23, 2021

Related issue = #2590

After this PR, dynamic indexing of matrix field elements will be enabled when dynamic_index=True is set during ti.init() and dynamic_index_stride is successfully calculated (#3854).

To achieve that and keep code simple, this PR does a lot of refactoring:

  • Unify local_subscript_with_offset and global_subscript_with_offset into make_tensor_element_expr;
  • Pass dynamic_index_stride into TensorElementExpression instead of calculating stride inside TensorElementExpression, which is not feasible now.

@netlify
Copy link

netlify bot commented Dec 23, 2021

✔️ Deploy Preview for jovial-fermat-aa59dc canceled.

🔨 Explore the source changes: f2aa43d

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

@strongoier
Copy link
Contributor Author

/format

Copy link
Member

@k-ye k-ye left a comment

Choose a reason for hiding this comment

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

LGTM!

@strongoier strongoier merged commit dfbc4b7 into taichi-dev:master Dec 27, 2021
@strongoier strongoier deleted the dyn-idx-mat branch December 27, 2021 11:24
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