-
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.
Don't let users disguise RVars as Vars
Fixes #7827
- Loading branch information
Showing
3 changed files
with
44 additions
and
9 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,21 @@ | ||
#include "Halide.h" | ||
|
||
#include <stdio.h> | ||
|
||
using namespace Halide; | ||
|
||
int main(int argc, char **argv) { | ||
Func f; | ||
Var x, y; | ||
|
||
RDom r(0, 10); | ||
f(x, y) += r; | ||
|
||
// Sneakily disguising an RVar as a Var by reusing the name should result in | ||
// an error. Otherwise it can permit schedules that aren't legal. | ||
Var xo, xi; | ||
f.update().split(Var(r.x.name()), xo, xi, 8, TailStrategy::RoundUp); | ||
|
||
printf("Success!\n"); | ||
return 0; | ||
} |