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

(transform): csl-stencil to csl-wrapper pass #2878

Merged
merged 10 commits into from
Jul 15, 2024
Merged

Conversation

n-io
Copy link
Collaborator

@n-io n-io commented Jul 11, 2024

Pass to lower csl_stencil to csl_wrapper.

  • Creates one csl_wrapper.module for each module-level function
  • Extracts stencil-related params to initialise csl_wrapper.modue and both of its layout_module and program_module regions
  • Initialises layout_module with everything required for running stencil programs and yields it to program_module, specifically: memcpy params, routes config, and isBorderRegionPE bool

Not in this PR:

  • Handling host-device transferable symbols and setting up exports
  • Setting up and exporting program entry point

As such, the translated func is currently simply placed inside the program_module.

Update:

  • Host-device transferable symbols are now added to the program_module block args
  • The function op is resolved
  • The function sym_name is stored as a property on the module
  • The function body is moved into the program module body
  • We set up a main entry point csl.func named after the translated func.func, transfer the ops into the new csl main func, and add the function to the program module body

@n-io n-io added the transformations Changes or adds a transformatio label Jul 11, 2024
@n-io n-io requested review from AntonLydike and dk949 July 11, 2024 12:06
@n-io n-io self-assigned this Jul 11, 2024
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.91%. Comparing base (9f4a53b) to head (c4a4a93).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2878      +/-   ##
==========================================
+ Coverage   89.85%   89.91%   +0.05%     
==========================================
  Files         399      400       +1     
  Lines       50171    50312     +141     
  Branches     7755     7776      +21     
==========================================
+ Hits        45083    45237     +154     
+ Misses       3860     3847      -13     
  Partials     1228     1228              

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

Copy link
Collaborator

@AntonLydike AntonLydike left a comment

Choose a reason for hiding this comment

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

Nice stuff! Would always love more comments, but the code is already quite a bit more readable than before!

xdsl/dialects/csl/csl_wrapper.py Show resolved Hide resolved
xdsl/dialects/csl/csl_wrapper.py Outdated Show resolved Hide resolved
xdsl/transforms/csl_stencil_to_csl_wrapper.py Outdated Show resolved Hide resolved
xdsl/transforms/csl_stencil_to_csl_wrapper.py Outdated Show resolved Hide resolved
xdsl/dialects/csl/csl_wrapper.py Show resolved Hide resolved
xdsl/transforms/csl_stencil_to_csl_wrapper.py Show resolved Hide resolved
xdsl/transforms/csl_stencil_to_csl_wrapper.py Outdated Show resolved Hide resolved
xdsl/transforms/csl_stencil_to_csl_wrapper.py Show resolved Hide resolved
xdsl/transforms/csl_stencil_to_csl_wrapper.py Outdated Show resolved Hide resolved
@n-io n-io requested a review from AntonLydike July 15, 2024 12:32
@n-io n-io merged commit 4d74242 into main Jul 15, 2024
10 checks passed
@n-io n-io deleted the nicolai/csl-wrapper-transform branch July 15, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
transformations Changes or adds a transformatio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants