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