LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ F77_sgemm()

void F77_sgemm ( CBLAS_INT layout,
char *  transpa,
char *  transpb,
CBLAS_INT m,
CBLAS_INT n,
CBLAS_INT k,
float *  alpha,
float *  a,
CBLAS_INT lda,
float *  b,
CBLAS_INT ldb,
float *  beta,
float *  c,
CBLAS_INT ldc 
)

Definition at line 12 of file c_sblas3.c.

14 {
15
16 float *A, *B, *C;
17 CBLAS_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 cblas_sgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA, CBLAS_TRANSPOSE TransB, const CBLAS_INT M, const CBLAS_INT N, const CBLAS_INT K, const float alpha, const float *A, const CBLAS_INT lda, const float *B, const CBLAS_INT ldb, const float beta, float *C, const CBLAS_INT ldc)
Definition cblas_sgemm.c:12
CBLAS_TRANSPOSE
Definition cblas.h:40
@ CblasNoTrans
Definition cblas.h:40
@ CblasColMajor
Definition cblas.h:39
@ CblasRowMajor
Definition cblas.h:39
#define CBLAS_INT
Definition cblas.h:24
#define UNDEFINED
Definition cblas_test.h:19
#define TEST_ROW_MJR
Definition cblas_test.h:12
#define TEST_COL_MJR
Definition cblas_test.h:16
void get_transpose_type(char *type, CBLAS_TRANSPOSE *trans)
Definition auxiliary.c:8
Here is the call graph for this function: