I have this example generator that fills a region (0,0,100,100) with black:
class MyGen : public Generator<MyGen>
{
public:
Var x, y;
Output<Func> output { "output", Int(32), 2 };
void generate()
{
output(x, y) = x + y;
RDom dom = RDom(0, 100, 0, 100);
output(dom.x, dom.y) = 0;
}
void schedule()
{
}
};
The region is filled correctly, but because of the pure definition, the rest of the image is a gradient (x+y).
Is there a way to write a pure definition that's not going to be executed (e.g. output(x,y) = output(x,y))?
Can I execute a Func
over a specific domain (e.g. Input<int>
s that define the region) without impacting the rest of the image?