root/test/correctness/multi_output_pipeline_with_bad_sizes.cpp

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. halide_error
  2. main

#include "Halide.h"
#include <stdio.h>

using namespace Halide;

bool error_occurred;
void halide_error(void *user_context, const char *msg) {
    printf("%s\n", msg);
    error_occurred = true;
}

int main(int argc, char **argv) {
    Func f;
    Var x;
    f(x) = Tuple(x, sin(x));

    // These should be the same size
    Buffer<int> x_out(100);
    Buffer<float> sin_x_out(101);

    f.set_error_handler(&halide_error);
    error_occurred = false;

    Realization r(x_out, sin_x_out);
    f.realize(r);

    if (!error_occurred) {
        printf("There should have been an error\n");
        return -1;
    }

    return 0;
}

/* [<][>][^][v][top][bottom][index][help] */