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

Definition at line 12 of file c_sblas3.c.

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

Here is the call graph for this function: