14 {
15
16 float *A, *B, *C;
19
22
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 }
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];
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 }
68 b, *ldb, *beta, c, *ldc );
69 else
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)
void get_transpose_type(char *type, CBLAS_TRANSPOSE *trans)