-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add two new tail strategies for update definitions #7949
Changes from all commits
0504add
a6e5b9b
07f152a
69fa46c
ccfcb4c
1d1eebf
ad128dd
0311797
179704e
9d064ff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,32 @@ enum class TailStrategy { | |
* instead of a multiple of the split factor as with RoundUp. */ | ||
ShiftInwards, | ||
|
||
/** Equivalent to ShiftInwards, but protects values that would be | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really think we need to have some kind of tutorial for all of the different variants of TailStrategy: there are a lot of them and some of them are pretty subtle, so it's not really obvious how exactly they work. No need to block PR on this though, but maybe would be good to create an issue. |
||
* re-evaluated by loading the memory location that would be stored to, | ||
* modifying only the elements not contained within the overlap, and then | ||
* storing the blended result. | ||
* | ||
* This tail strategy is useful when you want to use ShiftInwards to | ||
* vectorize without a scalar tail, but are scheduling a stage where that | ||
* isn't legal (e.g. an update definition). | ||
* | ||
* Because this is a read - modify - write, this tail strategy cannot be | ||
* used on any dimension the stage is parallelized over as it would cause a | ||
* race condition. | ||
*/ | ||
ShiftInwardsAndBlend, | ||
|
||
/** Equivalent to RoundUp, but protected values that would be written beyond | ||
* the end by loading the memory location that would be stored to, | ||
* modifying only the elements within the region being computed, and then | ||
* storing the blended result. | ||
* | ||
* This tail strategy is useful when vectorizing an update to some sub-region | ||
* of a larger Func. As with ShiftInwardsAndBlend, it can't be combined with | ||
* parallelism. | ||
*/ | ||
RoundUpAndBlend, | ||
|
||
/** For pure definitions use ShiftInwards. For pure vars in | ||
* update definitions use RoundUp. For RVars in update | ||
* definitions use GuardWithIf. */ | ||
|
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.
Might be good to add a similar comment to above that this loop propagates back (thus all of the if conditions and bodies are reversed) from the root to the child vars which of them are connected to parallel var.