Skip to content

Demonstrate splitting struct into individual scalars - #150

Draft
VictorYing wants to merge 1 commit into
GraphIt-DSL:swarm_backendfrom
VictorYing:split-struct-into-scalars
Draft

Demonstrate splitting struct into individual scalars#150
VictorYing wants to merge 1 commit into
GraphIt-DSL:swarm_backendfrom
VictorYing:split-struct-into-scalars

Conversation

@VictorYing

@VictorYing VictorYing commented Apr 9, 2021

Copy link
Copy Markdown
Collaborator

This us a fairly mechanical transformation to the generated C++:

  • Add local variable definitions at the top of the lambda body to extract the fields from the struct.
  • Avoid any direct use of the struct elsewhere in the lambda body: replace any access to the fields of the struct to an access to the corresponding local scalar variable.

After this transformation, SCC/T4 does a slightly better job packing registers and deciding how to transfer values between the fine-grained tasks created by SCC/T4 within the lambda body, and this manages to avoid one instance of a mem_runner (i.e., transfer via the heap) for one task spawn associated with the for loop inside of case 1.

@VictorYing VictorYing self-assigned this Apr 9, 2021
@VictorYing
VictorYing marked this pull request as draft April 9, 2021 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant