-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tuple output bounds checks (#7345)
Fix #7343 Tuple outputs weren't getting appropriate bounds checks due to overzealous culling of uninteresting code in the add_image_checks pass.
- Loading branch information
Showing
3 changed files
with
39 additions
and
2 deletions.
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
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,26 @@ | ||
#include "Halide.h" | ||
|
||
using namespace Halide; | ||
|
||
int main(int argc, char **argv) { | ||
// The code below used to not inject appropriate bounds checks. | ||
// See https://github.com/halide/Halide/issues/7343 | ||
|
||
Var x; | ||
|
||
const int size = 1024; | ||
|
||
Func h; | ||
h(x) = {0, 0}; | ||
RDom r(0, size); | ||
h(r) = {h(r - 100)[0], 0}; | ||
|
||
Var xo, xi; | ||
h.split(x, xo, xi, 16, TailStrategy::RoundUp); | ||
|
||
Buffer<int> r0(size); | ||
Buffer<int> r1(size); | ||
h.realize({r0, r1}); | ||
|
||
return 0; | ||
} |