Modified SDFGState.unordered_arglist()
#1708
Merged
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 fixes the way how arguments are detected in scopes.
Technically this only affects GPU code generation, but it is a side effect of how the code is generated.
In GPU mode a
Map
is translated into one kernel, for this reason a signature must be computed (this is the reason why CPU code generation is not affected, no function call is produced).To compute this signature the
unsorted_arglist()
function scans what is needed.However, this was implemented not correctly.
Assume that AccessNode for array
A
is outside the map and inside the map a temporary scalar,tmp_in
is defined and initialized totmp_in = A[__i0, __i1]
, see also this image:If the
data
property of the Memlet that connects the MapEntry with the AccessNode fortmp_in
is referencingA
then the (old) function would find thatA
is needed inside, although there is no AccessNode forA
inside the map.If however, this Memlet referrers
tmp_in
(which is not super standard, but should be allowed), then the old version would not pick up.This would then lead to a code generation error.
This PR modifies the function such that such cases are handled.
This is done by following all edges that are adjacent to the MapEntry (from the inside) to where the are actually originate.