This source file includes following definitions.
- halide_error
- main
#include "Halide.h"
#include <stdio.h>
using namespace Halide;
int error_occurred = false;
void halide_error(void *ctx, const char *msg) {
printf("Expected: %s\n", msg);
error_occurred = true;
}
int main(int argc, char **argv) {
Func f("f"), g("g"), h("h");
Var x("x"), y("y"), xi("xi"), yi("yi");
Param<int> split("split");
f(x, y) = x + y;
h(x, y) = f(x, y);
g(x, y) = h(x % split, y % split) + 1;
g.tile(x, y, xi, yi, split, split).parallel(y);
f.compute_at(g, y);
h.compute_at(g, x);
h.bound(x, 0, 10);
split.set(11);
g.set_error_handler(&halide_error);
g.realize(40, 40);
if (!error_occurred) {
printf("There was supposed to be an error\n");
return -1;
}
printf("Success!\n");
return 0;
}