Exemple #1
0
void prog01()
{
  Halide::Var x;
  Halide::Func init_cond;
  init_cond(x) = 1.0f*x;
  Halide::Image<float_t> input, output;
  input=init_cond.realize(NX);

  Halide::ImageParam inPar(Halide::Float(32), 1, "inPar");
  Halide::Func cell;
  cell(x)=inPar(x)+1;
  
  {
    std::vector<Halide::Argument> arg_vect;
    arg_vect.push_back(Halide::Argument("inPar", true, Halide::Int(32)));
    cell.compile_to_bitcode("stencil-fusion-01.bc", arg_vect, "blur");
  }


  for (int t =0; t < 100000; ++t) {
    inPar.set(input);
    output = cell.realize(NX);
    swap(output,input);
  }

  for (int i = 0; i < NX; ++i) 
    cout << input(i) << " ";
  cout << endl;
}
Exemple #2
0
void func_compile_to_bitcode0(h::Func &that, const std::string &filename,
                              const std::vector<h::Argument> &args,
                              const std::string fn_name = "",
                              const h::Target &target = h::get_target_from_environment())
{
    that.compile_to_bitcode(filename, args, fn_name, target);
    return;
}