fix[next-dace]: Add entry-point synchronization#2527
Open
edopao wants to merge 7 commits intoGridTools:mainfrom
Open
fix[next-dace]: Add entry-point synchronization#2527edopao wants to merge 7 commits intoGridTools:mainfrom
edopao wants to merge 7 commits intoGridTools:mainfrom
Conversation
Contributor
philip-paul-mueller
left a comment
There was a problem hiding this comment.
Looks good, I have some small suggestions.
| ) | ||
| if sync_states is None: | ||
| # Use the newly created entry if-region as new source node | ||
| for source_state in sdfg.source_nodes(): |
Contributor
There was a problem hiding this comment.
This assumes that all nodes in the SDFG are states and we do not have nested controlflow regions, which is currently true.
This means if we ever change the design we would have to modify this code as well.
So I would eitehr generalize it or add a if not isinstance(source_state, dace.SDFGState) raise NotImplemented() exception to it to be notified.
| Args: | ||
| sdfg: The SDFG to be instrumented with time measurements. | ||
| gpu: Flag that specifies if the SDFG is targeting GPU execution. | ||
| sync_states: If provided, a tuple of two states, the source state and the |
Contributor
There was a problem hiding this comment.
What do you mean with "source state" if you mean the first state in the SDFG then I would suggest using sdfg.start_block/sdfg.start_state.
| if sync_states is None: | ||
| # Use the newly created entry if-region as new source node | ||
| for source_state in sdfg.source_nodes(): | ||
| if source_state not in [entry_if_region, exit_if_region]: |
Contributor
There was a problem hiding this comment.
I would slightly restructure the code to something like:
if sync_states is None:
sync_states = __find_sync_states__()
//Variable for the GPU case below
the-else-branch-of-the-if
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains two changes: