Revision 0aa3766355c7a108578ab45d1f752a91ce8f0f6e authored by Steven Johnson on 19 August 2019, 21:36:33 UTC, committed by Steven Johnson on 19 August 2019, 21:36:33 UTC
1 parent e110b79
Raw File
multitarget_generator.cpp
#include "Halide.h"

namespace {

class Multitarget : public Halide::Generator<Multitarget> {
public:
    Output<Buffer<uint32_t>> output{"output", 2};

    void generate() {
        Var x, y;
        if (get_target().has_feature(Target::Debug)) {
            output(x, y) = cast<uint32_t>((int32_t)0xdeadbeef);
        } else {
            output(x, y) = cast<uint32_t>((int32_t)0xf00dcafe);
        }
    }
};

}  // namespace

HALIDE_REGISTER_GENERATOR(Multitarget, multitarget)
back to top