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

dialect: (csl) Adds variables to the dialect #3183

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

dk949
Copy link
Collaborator

@dk949 dk949 commented Sep 17, 2024

Variables work very much like memref.global, but they are scalars.

Ops:

  • csl.variable: declare variable with optional default value
  • csl.get_var: get SSA value (constant) of the variable
  • csl.update_var set variable from ssa value

Types:

  • csl.var<T>: type of a variable

Variables work very much like `memref.global`, but they are scalars.
@dk949 dk949 requested review from AntonLydike and n-io September 17, 2024 14:32
@dk949 dk949 self-assigned this Sep 17, 2024
@dk949
Copy link
Collaborator Author

dk949 commented Sep 17, 2024

This is a little rough around the edges (no docstrings, minimal verification). I'll clean it up if we're happy with the general concept

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.02%. Comparing base (9ea3620) to head (a43901c).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3183      +/-   ##
==========================================
- Coverage   90.02%   90.02%   -0.01%     
==========================================
  Files         430      431       +1     
  Lines       54003    54258     +255     
  Branches     8353     8404      +51     
==========================================
+ Hits        48617    48845     +228     
- Misses       4038     4055      +17     
- Partials     1348     1358      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

From the former get_var and update_var respectively.
Copy link
Collaborator

@n-io n-io left a comment

Choose a reason for hiding this comment

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

Thanks, looks great

@dk949 dk949 merged commit c9c6df3 into main Sep 17, 2024
14 checks passed
@dk949 dk949 deleted the david/csl-dialect/csl-variable branch September 17, 2024 14:59
dk949 added a commit that referenced this pull request Sep 18, 2024
* docstrings
* verifications
* `get_element_type` in `VariableOp`

These are fixes which should have been in #3183
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.

2 participants