Skip to content

Conversation

@ryanmrichard
Copy link
Member

Is this pull request associated with an issue(s)?
No.

Description
This PR adds the Einstein-summation-convention DSL to TensorWrapper and implements it for basic
math operations.

TODOs
Finish adding DSL terms to Parser. Implementing the Eigen executor. Tests. Documentation.

@ryanmrichard ryanmrichard self-assigned this Dec 5, 2024
@ryanmrichard
Copy link
Member Author

I did not scope this PR well. I forgot how many pieces need to be in place before something like C("i,j") = A("i,j") + B("j,i"); just works. At present, C("i,j") = A("i,j") + B("i,j"); works (no permutation) and I'm going to call that a good stopping spot for this PR. The next PR will make permutations work (I left some infrastructure in this PR associated with those efforts as I intend to build off this PR). Highlights of this PR:

  • Adds rebind to the allocator (will need reallocate when we start to support different backends)
  • Adds addition and addition assignment to buffer (for now assumes layouts are the same before and after).
  • Stubs for permute and permute assignment (don't work because layouts won't be the same)
  • Adds ability to label buffers, so they can be composed like tensors.
  • Can print buffers.
  • Adds DummyIndices class for string parsing the labels on tensors, layouts, etc.
  • Adds Labeled class for extending the DSL to included objects paired with dummy indices.
  • Adds PairwiseParser to walk the abstract syntax tree and evaluate it in a pairwise manner.

Once this passes CI it's r2g (gcc has warning clang didn't).

@ryanmrichard ryanmrichard marked this pull request as ready for review December 12, 2024 16:35
@ryanmrichard ryanmrichard merged commit 7405e95 into master Dec 12, 2024
5 checks passed
@ryanmrichard ryanmrichard deleted the basic_math branch December 12, 2024 17:33
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