-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scheduler: simplify schedule constraints with respect to context
Before this commit, computing a schedule for the constraints [N] -> { A[] -> C[] : N <= 0; A[] -> B[0] : N >= 1; B[N-1] -> C[] : N >= 1 } would not combine the three statements into a single band, even if N is known to be non-negative (as specified by the context), while specializing the constraints to a specific value of N would result in such a single band. The reason is that the context was essentially being ignored and it is then impossible to shift C with respect to B because N is not known to be non-negative at the point where the shift is needed. This commit also does not use the context at that point, but it does do so at the point where the schedule constraints are extracted. In particular, every schedule constraint is simplified with respect to the context. This turns the constraint { A[] -> C[] : N <= 0 } into { A[] -> C[] : N == 0 } and then a shift that is valid across all constraints can be computed. For other cases, it may be required to also take into account the context elsewhere. Reported-by: le yin <[email protected]> Signed-off-by: Sven Verdoolaege <[email protected]>
- Loading branch information
Sven Verdoolaege
committed
Feb 12, 2023
1 parent
d219a7d
commit 5d5b77e
Showing
7 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This is a specialized version of leyin2?.sc (for N = 32), | ||
# showing that a single band is computed. | ||
domain: { A[]; B[0:31]; C[] } | ||
validity: { A[] -> B[0]; B[31] -> C[] } | ||
proximity: { A[] -> B[0]; B[31] -> C[] } |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
domain: "{ B[i0] : 0 <= i0 <= 31; C[]; A[] }" | ||
child: | ||
schedule: "[{ B[i0] -> [(i0)]; C[] -> [(31)]; A[] -> [(0)] }]" | ||
permutable: 1 | ||
coincident: [ 1 ] | ||
child: | ||
sequence: | ||
- filter: "{ A[] }" | ||
- filter: "{ B[i0] }" | ||
- filter: "{ C[] }" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This is a generalized version of leyin1.sc, | ||
# with an extra dependence that simplifies away when N = 32. | ||
# However, since N is known to be non-negative, this should still | ||
# produce a similar schedule (with a single band). | ||
# The exact form of the schedule depends on whether the whole-component or | ||
# the incremental scheduler is used. | ||
# This is the incremental scheduler version. | ||
# OPTIONS: --no-schedule-whole-component | ||
domain: [N] -> { A[]; B[0:N-1]; C[] } | ||
context: [N] -> { : N >= 0 } | ||
validity: [N] -> { A[] -> C[] : N <= 0; | ||
A[] -> B[0] : N >= 1; B[N-1] -> C[] : N >= 1 } | ||
proximity: [N] -> { A[] -> C[] : N <= 0; | ||
A[] -> B[0] : N >= 1; B[N-1] -> C[] : N >= 1 } |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
domain: "[N] -> { B[i0] : 0 <= i0 < N; C[]; A[] }" | ||
child: | ||
schedule: "[N] -> [{ B[i0] -> [(1 + i0)]; C[] -> [(N)]; A[] -> [(0)] }]" | ||
permutable: 1 | ||
coincident: [ 1 ] | ||
child: | ||
sequence: | ||
- filter: "[N] -> { A[]; B[i0] }" | ||
child: | ||
set: | ||
- filter: "[N] -> { A[] }" | ||
- filter: "[N] -> { B[i0] }" | ||
- filter: "[N] -> { C[] }" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This is a generalized version of leyin1.sc, | ||
# with an extra dependence that simplifies away when N = 32. | ||
# However, since N is known to be non-negative, this should still | ||
# produce a similar schedule (with a single band). | ||
# The exact form of the schedule depends on whether the whole-component or | ||
# the incremental scheduler is used. | ||
# This is the whole-component scheduler version. | ||
# OPTIONS: --schedule-whole-component | ||
domain: [N] -> { A[]; B[0:N-1]; C[] } | ||
context: [N] -> { : N >= 0 } | ||
validity: [N] -> { A[] -> C[] : N <= 0; | ||
A[] -> B[0] : N >= 1; B[N-1] -> C[] : N >= 1 } | ||
proximity: [N] -> { A[] -> C[] : N <= 0; | ||
A[] -> B[0] : N >= 1; B[N-1] -> C[] : N >= 1 } |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
domain: "[N] -> { B[i0] : 0 <= i0 < N; C[]; A[] }" | ||
child: | ||
schedule: "[N] -> [{ B[i0] -> [(i0)]; C[] -> [(N)]; A[] -> [(0)] }]" | ||
permutable: 1 | ||
coincident: [ 1 ] | ||
child: | ||
sequence: | ||
- filter: "[N] -> { A[] }" | ||
- filter: "[N] -> { C[] }" | ||
- filter: "[N] -> { B[i0] }" |