-
Notifications
You must be signed in to change notification settings - Fork 129
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
Various Cutout Fixes #1662
Various Cutout Fixes #1662
Conversation
phschaad
commented
Sep 19, 2024
•
edited
Loading
edited
- Fix cutouts w.r.t. the use of UIDs, allowing them to be preserved or re-generated depending on an input parameter
- Fix singlestate cutout extraction when memlets access struct members.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the new clone methods, is there any other way? Also, see comments
dace/sdfg/analysis/cutout.py
Outdated
:param override_start_block: If set, explicitly force a given control flow block to be the start block. If left | ||
None (default), the start block is automatically determined based on domination | ||
relationships in the original graph. | ||
:return: The created SDFGCutout or the original SDFG where no smaller cutout could be obtained. | ||
""" | ||
create_element = copy.deepcopy | ||
def create_element(x: Union[ControlFlowBlock, InterstateEdge]) -> Union[ControlFlowBlock, InterstateEdge]: | ||
return x.clone(keep_guid=preserve_guids) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use an inline lambda, it's much cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After removing the clone
function I believe it is cleaner this way since this way provides type information, while lambdas completely remove the ability to type hint things (cleanly)