graphit icon indicating copy to clipboard operation
graphit copied to clipboard

Demonstrate splitting struct into individual scalars

Open VictorYing opened this issue 3 years ago • 0 comments

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 avatar Apr 09 '21 14:04 VictorYing