cpp: void kernel_doitgen(int nr, int nq, int np,\nDATA_TYPE POLYBENCH_3D(A,NR,NQ,NP,nr,nq,np),\nDATA_TYPE POLYBENCH_2D(C4,NP,NP,np,np),\nDATA_TYPE POLYBENCH_3D(sum,NR,NQ,NP,nr,nq,np))\n{\nint r, q, p, s;\n\n#pragma scop\nfor (r = 0; r < _PB_NR; r++)\nfor (q = 0; q < _PB_NQ; q++)  {\nfor (p = 0; p < _PB_NP; p++)  {\nsum[r][q][p] = 0;\nfor (s = 0; s < _PB_NP; s++)\nsum[r][q][p] = sum[r][q][p] + A[r][q][s] * C4[s][p];\n}\nfor (p = 0; p < _PB_NR; p++)\nA[r][q][p] = sum[r][q][p];\n}\n#pragma endscop\n\n}
fortran: subroutine kernel_doitgen(nr, nq, np , &\na, cFour, sumA)\nimplicit none\n\nDATA_TYPE, dimension(np, nq, nr) :: a\nDATA_TYPE, dimension(np, nq, nr) :: sumA\nDATA_TYPE, dimension(np, np) :: cFour\ninteger :: nr, nq, np\ninteger :: r, s, p, q\n\n!$pragma scop\ndo r = 1, _PB_NR\ndo q = 1, _PB_NQ\ndo p = 1, _PB_NP\nsumA(p, q, r) = 0.0D0\ndo s = 1, _PB_NP\nsumA(p, q, r) = sumA(p, q, r) + (a(s, q, r) * &\ncFour(p, s))\nend do\nend do\ndo p = 1, _PB_NP\na(p, q, r) = sumA(p, q, r)\nend do\nend do\nend do\n!$pragma endscop\nend subroutine