Efficient ImageProcessing withHalidePresented by Adrián Palacios
Introduction• Image processing is a topicwhere optimization matters.• But optimization for multipleplatforms is hard andexpensive.• We want tools for obtaininghigh-performance coderegardless of the platform.• Halide is a tool that aims tosolve this problem.
Data-parallel and IP languages• Data-parallel languages:• CUDA and OpenCL propose a SIMDprogramming model for multi-core CPUsand GPUs.• Implementations can be very efficient atthe cost of losing portability.• IP languages:• MATLAB and other suites release kernellanguages.• But individual kernels are not enough.
The Halide language• Halide is a functional programming language (“àla Haskell”) for IP.• It makes a distinction between the algorithm andthe schedule:• The algorithm is what should be done.• The schedule is how it should be done.• Optimization is achieved by:• Using LLVM for generating simple code.• Using architecture-specific compilers forgenerating vectorized and parallel code.
Evaluation of Halide• Halide’s execution time is measured against:• ImageMagick.• MATLAB.• Mathematica.• OpenCV 2.• Two test images:• A normal sized image (512x512).• A big sized image (6400x4800).• For two methods:• RGB to grayscale.• Gaussian blur.