cpp: void kernel_gemm(int ni, int nj, int nk,\nDATA_TYPE alpha,\nDATA_TYPE beta,\nDATA_TYPE POLYBENCH_2D(C,NI,NJ,ni,nj),\nDATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk),\nDATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj))\n{\nint i, j, k;\n\n#pragma scop\n/* C := alpha*A*B + beta*C */\nfor (i = 0; i < _PB_NI; i++)\nfor (j = 0; j < _PB_NJ; j++)\n{\nC[i][j] *= beta;\nfor (k = 0; k < _PB_NK; ++k)\nC[i][j] += alpha * A[i][k] * B[k][j];\n}\n#pragma endscop\n\n}
fortran: subroutine kernel_gemm(ni, nj, nk, alpha, beta, c, a, b)\nimplicit none\n\nDATA_TYPE, dimension(nk, ni) :: a\nDATA_TYPE, dimension(nj, nk) :: b\nDATA_TYPE, dimension(nj, ni) :: c\nDATA_TYPE :: alpha, beta\ninteger :: ni, nj, nk\ninteger :: i, j, k\n\n!$pragma scop\ndo i = 1, _PB_NI\ndo j = 1, _PB_NJ\nc(j, i) = c(j, i) * beta\ndo k  = 1, _PB_NK\nc(j, i) = c(j, i) + (alpha * a(k, i) * b(j, k))\nend do\nend do\nend do\n!$pragma endscop\nend subroutine