#include "Halide.h" namespace { class OpenCL_Runtime : public Halide::Generator { public: Input> input{"input", 2}; Output> output{"output", 2}; void generate() { Var x("x"), y("y"); // Create a simple pipeline that scales pixel values by 2. output(x, y) = input(x, y) * 2; Target target = get_target(); if (target.has_gpu_feature()) { Var xo, yo, xi, yi; output.gpu_tile(x, y, xo, yo, xi, yi, 16, 16); } } }; } // namespace HALIDE_REGISTER_GENERATOR(OpenCL_Runtime, opencl_runtime)