The result of the translation process is the imperative DPIA program shown in lst:dpia-matrix-vector-mult, from which we generate the OpenCL code shown in lst:opencl-matrix-vector-mult.
This final code generation step is small, as the structure of the imperative DPIA program directly corresponds to the OpenCL program.
For example, !parForWorkGroup! and !parForLocal! correspond to the two outer loops in line 6 and 8 in the OpenCL code.
The remaining gap is to resolve some functional expressions into multi-dimensional array indices.
This process is similar to the views in Lift [1]} and involves simplifying arithmetic expressions to generate concise indices.
The only conceptual difference to Lift is that in DPIA index computations also happen on acceptors to manipulate the location where we write into memory.
