This source file includes following definitions.
- main
#include "Halide.h"
#include <stdio.h>
using namespace Halide;
int main(int argc, char **argv) {
std::vector<Var> vars(20);
Func f;
Expr e = 0;
for (size_t i = 0; i < vars.size(); i++) {
vars[i] = Var();
e += vars[i];
}
f(vars) = e;
Func g;
Var x, y;
std::vector<Expr> site1(vars.size()), site2(vars.size());
for (size_t i = 0; i < vars.size(); i++) {
site1[i] = rand() & 0x1;
if (rand() & 1) site1[i] += x;
if (rand() & 1) site1[i] += y;
site1[i] = site1[i] % 2;
site2[i] = rand() & 0x1;
if (rand() & 1) site2[i] += x;
if (rand() & 1) site2[i] += y;
site2[i] = site2[i] % 2;
if (rand() & 4) {
site1[i] = site2[i];
}
}
g(x, y) = f(site1) + f(site2);
f.compute_at(g, x);
g.realize(10, 10);
printf("Success!\n");
return 0;
}