root/test/generator/matlab_generator.cpp

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

DEFINITIONS

This source file includes following definitions.
  1. build

#include "Halide.h"

using namespace Halide;

namespace {

class Matlab : public Halide::Generator<Matlab> {
public:
    ImageParam input{Float(32), 2, "input"};
    Param<float> scale{"scale"};
    Param<bool> negate{"negate"};

    Func build() {
        Var x, y;
        Func f("f");
        f(x, y) = input(x, y) * scale * select(negate, -1.0f, 1.0f);
        return f;
    }
};

Halide::RegisterGenerator<Matlab> register_matlab{"matlab"};

}  // namespace

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