benchmarks/framework_benchmarking/linear_algebra/PENCIL-gemm/gemm.c
static
void kernel_2mm(int ni, int nj, int nk, int nl,
		DATA_TYPE alpha,
		DATA_TYPE beta,
		DATA_TYPE POLYBENCH_2D(tmp,NI,NJ,ni,nj),
		DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk),
		DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj),
		DATA_TYPE POLYBENCH_2D(C,NJ,NL,nj,nl),
		DATA_TYPE POLYBENCH_2D(D,NI,NL,ni,nl))
{
  int i, j, k;

#pragma scop
  /* D := alpha*A*B*C + beta*D */
  for (i = 0; i < _PB_NI; i++)
    for (j = 0; j < _PB_NJ; j++)
      {
	tmp[i][j] = SCALAR_VAL(0.0);
	for (k = 0; k < _PB_NK; ++k)
	  tmp[i][j] += alpha * A[i][k] * B[k][j];
	tmp[i][j] += beta * C[i][j];
      }
#pragma endscop

}
/* Main computational kernel. The whole function will be timed,
   including the call and return. */
Main computational kernel. The whole function will be timed,
including the call and return.
Main computational kernel . The whole function will be timed including the call and return .
static
void kernel_2mm(int ni, int nj, int nk, int nl,
		DATA_TYPE alpha,
		DATA_TYPE beta,
		DATA_TYPE POLYBENCH_2D(tmp,NI,NJ,ni,nj),
		DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk),
		DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj),
		DATA_TYPE POLYBENCH_2D(C,NJ,NL,nj,nl),
		DATA_TYPE POLYBENCH_2D(D,NI,NL,ni,nl))
{
  int i, j, k;
#pragma scop
  for (i = 0; i < _PB_NI; i++)
    for (j = 0; j < _PB_NJ; j++)
      {
	tmp[i][j] = SCALAR_VAL(0.0);
	for (k = 0; k < _PB_NK; ++k)
	  tmp[i][j] += alpha * A[i][k] * B[k][j];
	tmp[i][j] += beta * C[i][j];
      }
#pragma endscop
}
static void kernel_2mm ( int ni , int nj , int nk , int nl , DATA_TYPE alpha , DATA_TYPE beta , DATA_TYPE POLYBENCH_2D ( tmp , NI , NJ , ni , nj ) , DATA_TYPE POLYBENCH_2D ( A , NI , NK , ni , nk ) , DATA_TYPE POLYBENCH_2D ( B , NK , NJ , nk , nj ) , DATA_TYPE POLYBENCH_2D ( C , NJ , NL , nj , nl ) , DATA_TYPE POLYBENCH_2D ( D , NI , NL , ni , nl ) ) { int i , j , k ; #pragma  scop for ( i = 0 ; i < _PB_NI ; i ++ ) for ( j = 0 ; j < _PB_NJ ; j ++ ) { tmp [ i ] [ j ] = SCALAR_VAL ( 0.0 ) ; for ( k = 0 ; k < _PB_NK ; ++ k ) tmp [ i ] [ j ] += alpha * A [ i ] [ k ] * B [ k ] [ j ] ; tmp [ i ] [ j ] += beta * C [ i ] [ j ] ; } #pragma  endscop }
Main computational kernel.
Main computational kernel .
/* D := alpha*A*B*C + beta*D */