Our research goal is to retarget image processing programs written in sequential languages (e.g., C) to architectures with data-parallel processing capabilities. Image processing algorithms are often inherently data-parallel, but the artifacts imposed by the sequential programming language (e.g., loops, pointer variables, linear address spaces) can obscure the parallelism and prohibit generation of efficient parallel code. This paper proposes a program representation and pattern-recognition approach for generating a data-parallel program specification from sequential source code. The representation is based on an extension of the multi-dimensional synchronous dataflow (MDSDF) model of computation.
Central to extracting this representation from code is understanding the mapping between iterations and array variables in the source code and the operations over array regions (e.g., rows, columns, tiled blocks) that they implement. Examples are presented to illustrate this mapping, and a set of patterns for recognizing these regions are proposed. The correctness of the retargeted MDSDF specifications are validated and the potential speedup from parallel execution shown.