I am new in Halide.
I am trying to do some calculation where pixel position 'x' should be set as the limit of the for loop. For that, I wrote the following code but it seems i can not use halide variable as a limit of a for loop.
Is there a solution for that?
My code:
Halide::Var x, y;
Halide::Expr L;
Halide::Func mat,A;
L = 0;
for (int k=1; k<=x-1; k++)
L += mat(k,y) * mat(k,x);
mat(x,y) = Halide::select(x==y, (A(x, y) - L),
y>x, (A(x,y) - L)/mat(x,x),
0);
it gives the error message:
"error: could not convert ‘Halide::operator<=(int, Halide::Expr) Halide::operator-(Halide::Expr, int)(1))’ from ‘Halide::Expr’ to ‘bool’ for (int k=1; k<=x-1; k++)"