1 Introduction
The stencil computation is identified as one of the thirteen Berkeley motifs and represents a very common class of nested loops in scientific and engineering applications, dynamic programming, and image processing algorithms. A stencil is a pre-defined pattern of neighbor points used for updating a given point. The stencil computation involves time-iterated updates on a regular d-dimensional grid, called the data space or spatial space. The data space is updated along the time dimension, generating a (d + 1) -dimensional space referred to as the iteration space. The stencils can be classified from various perspectives, such as the grid dimensions (1D, 2D, …), orders (number of neighbors, 3-point, 5-point, …), shapes (box, star, …), dependence types (Gauss-Seidel, Jacobi) and boundary conditions (constant, periodic, …).