#include "Halide.h"
#include <stdio.h>
int main(int argc, char **argv) {
Func gradient(
"gradient");
gradient(x, y) = x + y;
printf("Evaluating gradient from (0, 0) to (7, 7)\n");
for (int y = 0; y < 8; y++) {
for (int x = 0; x < 8; x++) {
if (result(x, y) != x + y) {
printf("Something went wrong!\n");
return -1;
}
}
}
shifted.set_min(100, 50);
printf("Evaluating gradient from (100, 50) to (104, 56)\n");
for (int y = 50; y < 57; y++) {
for (int x = 100; x < 105; x++) {
if (shifted(x, y) != x + y) {
printf("Something went wrong!\n");
return -1;
}
}
}
printf("Success!\n");
return 0;
}
A Halide::Buffer is a named shared reference to a Halide::Runtime::Buffer.
Func & trace_stores()
Trace all stores to the buffer backing this Func by emitting calls to halide_trace.
Realization realize(std::vector< int32_t > sizes={}, const Target &target=Target())
Evaluate this function over some rectangular domain and return the resulting buffer or buffers.
A Halide variable, to be used when defining functions.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...