Revision 4abb1898dd808727c46e4691e2ccb466f08004e7 authored by Steven Johnson on 19 August 2020, 18:31:01 UTC, committed by Steven Johnson on 19 August 2020, 18:31:01 UTC
2 parent s eba0790 + d1f34da
Raw File
bad_rvar_order.cpp
#include "Halide.h"
#include <stdio.h>

using namespace Halide;

int main(int argc, char **argv) {
    RDom r1(0, 10, 0, 10);

    Func f("f");
    Var x, y;
    f(x, y) = x + y;
    f(r1.x, r1.y) += f(r1.y, r1.x);

    // It's not permitted to change the relative ordering of reduction
    // domain variables when it could change the meaning.
    f.update().reorder(r1.y, r1.x);

    f.realize(10, 10);

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