Stencil computation is the basis for the Reverse Time Migration algorithm in seismic computing. The underlying mathematical problem is to solve the wave equation using a finite difference method. This sample computes a 3-D 25-point stencil. The computation contains 4 layer loops for each dimention and time duration. One methodology runs in straight scalar code, one using Intel® Cilk™ Plus
to allow the code to vectorize, one using
to include parallelization, and one with both.