LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
void F77_dgemm ( int *  layout,
char *  transpa,
char *  transpb,
int *  m,
int *  n,
int *  k,
double *  alpha,
double *  a,
int *  lda,
double *  b,
int *  ldb,
double *  beta,
double *  c,
int *  ldc 
)

Definition at line 14 of file c_dblas3.c.

16  {
17 
18  double *A, *B, *C;
19  int i,j,LDA, LDB, LDC;
20  CBLAS_TRANSPOSE transa, transb;
21 
22  get_transpose_type(transpa, &transa);
23  get_transpose_type(transpb, &transb);
24 
25  if (*layout == TEST_ROW_MJR) {
26  if (transa == CblasNoTrans) {
27  LDA = *k+1;
28  A = (double *)malloc( (*m)*LDA*sizeof( double ) );
29  for( i=0; i<*m; i++ )
30  for( j=0; j<*k; j++ )
31  A[i*LDA+j]=a[j*(*lda)+i];
32  }
33  else {
34  LDA = *m+1;
35  A = ( double* )malloc( LDA*(*k)*sizeof( double ) );
36  for( i=0; i<*k; i++ )
37  for( j=0; j<*m; j++ )
38  A[i*LDA+j]=a[j*(*lda)+i];
39  }
40  if (transb == CblasNoTrans) {
41  LDB = *n+1;
42  B = ( double* )malloc( (*k)*LDB*sizeof( double ) );
43  for( i=0; i<*k; i++ )
44  for( j=0; j<*n; j++ )
45  B[i*LDB+j]=b[j*(*ldb)+i];
46  }
47  else {
48  LDB = *k+1;
49  B = ( double* )malloc( LDB*(*n)*sizeof( double ) );
50  for( i=0; i<*n; i++ )
51  for( j=0; j<*k; j++ )
52  B[i*LDB+j]=b[j*(*ldb)+i];
53  }
54  LDC = *n+1;
55  C = ( double* )malloc( (*m)*LDC*sizeof( double ) );
56  for( j=0; j<*n; j++ )
57  for( i=0; i<*m; i++ )
58  C[i*LDC+j]=c[j*(*ldc)+i];
59 
60  cblas_dgemm( CblasRowMajor, transa, transb, *m, *n, *k, *alpha, A, LDA,
61  B, LDB, *beta, C, LDC );
62  for( j=0; j<*n; j++ )
63  for( i=0; i<*m; i++ )
64  c[j*(*ldc)+i]=C[i*LDC+j];
65  free(A);
66  free(B);
67  free(C);
68  }
69  else if (*layout == TEST_COL_MJR)
70  cblas_dgemm( CblasColMajor, transa, transb, *m, *n, *k, *alpha, a, *lda,
71  b, *ldb, *beta, c, *ldc );
72  else
73  cblas_dgemm( UNDEFINED, transa, transb, *m, *n, *k, *alpha, a, *lda,
74  b, *ldb, *beta, c, *ldc );
75 }
void get_transpose_type(char *type, CBLAS_TRANSPOSE *trans)
Definition: auxiliary.c:8
#define UNDEFINED
Definition: c_dblas3.c:12
#define TEST_COL_MJR
Definition: c_dblas3.c:10
#define TEST_ROW_MJR
Definition: c_dblas3.c:11
#define LDB
Definition: example_user.c:13
CBLAS_TRANSPOSE
Definition: cblas.h:20
#define LDA
Definition: example_user.c:12
void cblas_dgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA, CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const double alpha, const double *A, const int lda, const double *B, const int ldb, const double beta, double *C, const int ldc)
Definition: cblas_dgemm.c:12

Here is the call graph for this function: