Revision 1291171110b1ed2cf9b8b8a01cc5a1b12f2a48bc authored by Dan Palermo on 25 May 2021, 17:42:55 UTC, committed by Dan Palermo on 25 May 2021, 17:42:55 UTC
1 parent 83ab565
Raw File
bad_fold.cpp
#include "Halide.h"
#include <stdio.h>

using namespace Halide;

int main(int argc, char **argv) {
    Var x, y, c;

    Func f, g;

    f(x, y) = x;
    g(x, y) = f(x - 1, y + 1) + f(x, y - 1);
    f.store_root().compute_at(g, y).fold_storage(y, 2);

    Buffer<int> im = g.realize({100, 1000});

    printf("Success!\n");
    return 0;
}
back to top