Halide (programming Language)
   HOME

TheInfoList



OR:

Halide is a computer
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
designed for writing digital image processing code that takes advantage of
memory locality In computer science, locality of reference, also known as the principle of locality, is the tendency of a processor to access the same set of memory locations repetitively over a short period of time. There are two basic types of reference localit ...
, vectorized computation and multi-core
CPU A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, and ...
s and GPUs. Halide is implemented as an internal
domain-specific language A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging f ...
(DSL) in C++.


Language

The main innovation Halide brings is the separation of the
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algorithms are used as specificat ...
being implemented from its execution schedule, i.e. code specifying the
loop Loop or LOOP may refer to: Brands and enterprises * Loop (mobile), a Bulgarian virtual network operator and co-founder of Loop Live * Loop, clothing, a company founded by Carlos Vasquez in the 1990s and worn by Digable Planets * Loop Mobile, an ...
nesting, parallelization, loop unrolling and vector instruction. These two are usually interleaved together and experimenting with changing the schedule requires the programmer to rewrite large portions of the algorithm with every change. With Halide, changing the schedule does not require any changes to the algorithm and this allows the programmer to experiment with scheduling and finding the most efficient one.


Sample source code

The following function defines and sets the schedule for a 3×3
box filter A box blur (also known as a box linear filter) is a spatial domain linear filter in which each pixel in the resulting image has a value equal to the average value of its neighboring pixels in the input image. It is a form of low-pass ("blurring") f ...
defined as a series of two 3×1 passes: Func blur_3x3(Func input)


Use

Google used Halide and TensorFlow for its Pixel 2
Pixel Visual Core The Pixel Visual Core (PVC) is a series of ARM-based system in package (SiP) image processors designed by Google. The PVC is a fully programmable image, vision and AI multi-core domain-specific architecture (DSA) for mobile devices and in futur ...
. Adobe Photoshop also uses Halide. Both Google and Adobe have been involved in Halide research.


See also

* Cuneiform (programming language) * Algorithmic skeleton * Parallel programming model


References


External links


http://halide-lang.org/

Decoupling Algorithms from Schedules for Easy Optimization of Image Processing Pipelines
*  {{small, (8,259 KB) Image processing Functional languages Parallel computing