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] MatrixField refactor 5/n: Lower access of matrix field element into CHI IR #6119

Merged
merged 6 commits into from
Sep 21, 2022

Conversation

strongoier
Copy link
Contributor

Issue: #5959

Brief Summary

This PR lowers access of matrix field element into CHI IR. To verify its functionality, this PR also makes the following path of #5959 running end-to-end (currently only enabled when real_matrix=True):

MatrixField_Part5

Key steps:

  • Python: when running into subscript of MatrixField, create IndexExpression in C++ instead of building _MatrixFieldElement in Python
  • Frontend IR: allow IndexExpression to take MatrixFieldExpression
  • CHI IR: add MatrixOfGlobalPtrStmt; add lower_matrix_ptr pass, which demotes PtrOffsetStmt(MatrixOfGlobalPtrStmt) into GlobalPtrStmt in the case of constant index - this is incomplete and only aims at supporting the above path

@netlify
Copy link

netlify bot commented Sep 20, 2022

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit c2147d4
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/632acbd29a5a090008a2a3f6
😎 Deploy Preview https://deploy-preview-6119--docsite-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

taichi/ir/expr.cpp Outdated Show resolved Hide resolved
taichi/ir/frontend_ir.cpp Outdated Show resolved Hide resolved
taichi/transforms/lower_matrix_ptr.cpp Show resolved Hide resolved
tests/python/test_matrix.py Show resolved Hide resolved
Copy link
Contributor

@jim19930609 jim19930609 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 af76f25 into taichi-dev:master Sep 21, 2022
@strongoier strongoier deleted the mat-5 branch September 21, 2022 09:47
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