Jump to content

Halide (programming language)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Padenton (talk | contribs) at 15:11, 31 March 2015 (Nominated for deletion; see Wikipedia:Articles for deletion/Halide (programming language). (TW)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Halide
Designed byJonathan Ragan-Kelley and Andrew Adams
DeveloperMIT, (with help from Stanford and Adobe)
First appeared2012
OSMac OS X (10.6 through 10.8), mainstream Linux distributions
Websitehttp://halide-lang.org/

Halide is a computer programming language designed to make it easier to write image processing code that a compiler can efficiently and automatically parallelize onto a Graphical Processing Unit (GPU) pipeline.[1]

Sample source code

Func blur_3x3(Func input) {
  Func blur_x, blur_y;
  Var x, y, xi, yi;

  // The algorithm - no storage or order
  blur_x(x, y) = (input(x-1, y) + input(x, y) + input(x+1, y))/3;
  blur_y(x, y) = (blur_x(x, y-1) + blur_x(x, y) + blur_x(x, y+1))/3;

  // The schedule - defines order, locality; implies storage
  blur_y.tile(x, y, xi, yi, 256, 32)
        .vectorize(xi, 8).parallel(y);
  blur_x.compute_at(blur_y, x).vectorize(x, 8);

  return blur_y;
}

References

  1. ^ "Halide - New Language For Image Processing". 2012. Retrieved 20 September 2013.