Halide
Halide copied to clipboard
Error out when calling rfactor() after fusing a pure var
Fixes #7854
This needs more work.
- It doesn't handle a pure var higher up in a tree of fusions; that needs to be fixed somehow
- I discovered a secondary bug, as follows:
#include "Halide.h"
using namespace Halide;
int main(int argc, char **argv) {
Func f{"f"};
RDom r({{0, 5}, {0, 5}, {0, 5}}, "r");
Var x{"x"}, y{"y"};
f(x, y) = 0;
f(x, y) += r.x + r.y + r.z;
RVar rxy{"rxy"}, yrz{"yrz"};
Var z{"z"};
// Error: In schedule for f.update(0), could not find remove dimension: r$z
// Vars: r$x.rxy r$z.yrz x __outermost
f.update()
.fuse(r.x, r.y, rxy)
.fuse(r.z, y, yrz)
.rfactor(rxy, z);
f.print_loop_nest();
printf("Success!\n");
return 0;
}
What's the status on this PR?
What's the status on this PR?
Not close to ready yet. Need to clear my plate a bit.
Closing in favor of a new PR