For question related to the Halide domain-specific language including scheduling, and computations. Halide supports different languages such as C, C++, Matlab/octave and Python. Please consider a language tag as well.
Overview
Halide is an open-source domain-specific language which allows flexibility in iterating over dimensions to apply computations.
There are two basic parts to Halide code. One describes the computations and the second is the schedule. The schedule allows trade-offs between redundant computations, cache locality and parallelism as the computations iterate over the data space.
Halide is principally used for image processing and computational photography, but it can be applied to audio, encryption, machine vision, and physical simulation. In some ways, Halide is an aspect oriented framework; it separates the description of the algorithm from the definition of how that algorithm is to be implemented via a schedule.
Halide is embedded within C++ and uses the LLVM plug-in mechanics to generate code. Two modes are supported:
- JIT (just in time) - in this mode, the code is created at run time. The generated code is available to be called. The Halide code consists of templates and classes which may be updated at runtime. This mode is very flexible for iterating over different design choices.
- AOT (ahead of time) - this is like a more traditional compilation mode. Two executeables are built. One is a generator which creates an object file with several functions. The object file take parameters (buffers, etc) and produces outputs (buffers, constants). The generates object can be linked to many languages that are ABI compliant, such as c even thought the primary language used to code Halide is C++.
It can be helpful to specify which mode you are targeting when asking questions.
Resources/References
The Halide tutorials give a gentle introduction to topics and concepts related to the framework.
More information can be found on the website: http://halide-lang.org
Much of the information here is taken from a CppCon 2020 video by Alex Reinking.