MDH High-Level Program Representation
MDH’s High-Level Program Representation gives data-parallel computations a compact, regular structure based on three higher-order functions composed in a fixed order:
inp_viewcaptures the accesses to the input datamd_homexpresses the data-parallel computationout_viewcaptures the accesses to the output data

In the Matrix-Vector Multiplication (MatVec) example above:
inp_viewdefines two inputs: a matrixMof sizeIxKand a vectorvof sizeK; at each point(i,k), the matrix is accessed at position(i,k)and the vector at position(k).md_hommultiplies the matrix and vector elements using*, then combines the intermediate results along thei-dimension using concatenation (++in MDH) and along thek-dimension using point-wise addition (+).out_viewis trivial in this example, but it can define more advanced output access patterns, such as storing the result of Matrix Multiplication (MatMul) in transposed form.