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

ComponentTensor has no code generation #16

Open
miklos1 opened this issue Feb 12, 2016 · 4 comments
Open

ComponentTensor has no code generation #16

miklos1 opened this issue Feb 12, 2016 · 4 comments
Assignees

Comments

@miklos1
Copy link
Member

miklos1 commented Feb 12, 2016

They are all removed before code generation through renaming indices. Unfortunately this may cause some duplication in the generated code. One known case is the Jacobian inverse, but there may be others.

The UFL snippet for matrix inversion is to assemble the adjugate (ListTensor), and then element-wise divide it by the determinant (ComponentTensor). If the Jacobian inverse is applied several times, then the division step will happen several times due to the "inlining" of ComponentTensors. While this particular problem can be "fixed" by changing the UFL snippet, the same problem might arise in other cases as well.

@wence-
Copy link
Contributor

wence- commented Feb 15, 2016

I guess the refcounting of temporaries doesn't take care of this?

@miklos1 miklos1 self-assigned this Apr 25, 2017
@miklos1 miklos1 removed their assignment Jul 12, 2018
@sv2518
Copy link
Contributor

sv2518 commented Mar 25, 2020

I have introduced code generation of ComponentTensors by translating them into loopy in the branch translation-of-comptensors. Currently I am not doing any optimisations on the expressions which are translated from Slate to gem. I am unsure if I will still need ComponentTensor code generation after including the optimisations.

@sv2518 sv2518 self-assigned this Mar 25, 2020
@wence-
Copy link
Contributor

wence- commented May 1, 2020

ComponentTensor does now have code generation via #203. However the optimisation that needs to be applied in the original description is not yet applied.

@miklos1
Copy link
Member Author

miklos1 commented May 6, 2020

I may write up the optimisations mentioned in the description as two separate issues, and then this issue could be closed.

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

No branches or pull requests

3 participants