You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to implement the following C++ equivalent code in Halide, whereby the coordinates used in the for loop are different from the coordinates used for assignment within the loop body (the assignment coordinates are computed inside the loop body):
`for (int ty = 0; ty < MAX_TY; ty++){
for (int tx = 0; tx < MAX_TX; tx++){
for (int yi = 0; yi < T_SIZE; yi++){
for (int xi = 0; xi < T_SIZE; xi++){
int x = tx * T_SIZE/2 + xi;
int y = ty * T_SIZE/2 + yi;
output[y][x] += input[ty][tx][yi][xi];
}
}
}
}`
I tried to use the following Halide line to implement the loop:
whereby tx, ty, xi, and yi have been defined as Vars, and T_SIZE has been defined as a constant. However, running this code results in the following error: Undefined variable "tx" in definition of Func "output".
Why is this error message being thrown, and what would be an acceptable way to implement this nested for loop in Halide?
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
I am trying to implement the following C++ equivalent code in Halide, whereby the coordinates used in the for loop are different from the coordinates used for assignment within the loop body (the assignment coordinates are computed inside the loop body):
`for (int ty = 0; ty < MAX_TY; ty++){
I tried to use the following Halide line to implement the loop:
output(tx * T_SIZE/2 + xi, ty * T_SIZE/2 + yi) += input(tx, ty, xi, yi)
whereby tx, ty, xi, and yi have been defined as Vars, and T_SIZE has been defined as a constant. However, running this code results in the following error: Undefined variable "tx" in definition of Func "output".
Why is this error message being thrown, and what would be an acceptable way to implement this nested for loop in Halide?
Thanks!
The text was updated successfully, but these errors were encountered: