10 #define TEST_COL_MJR 0
11 #define TEST_ROW_MJR 1
14 void F77_dgemm(
int *layout,
char *transpa,
char *transpb,
int *m,
int *n,
15 int *k,
double *alpha,
double *a,
int *lda,
double *b,
int *ldb,
16 double *beta,
double *c,
int *ldc ) {
28 A = (
double *)malloc( (*m)*LDA*
sizeof( double ) );
31 A[i*LDA+j]=a[j*(*lda)+i];
35 A = (
double* )malloc( LDA*(*k)*
sizeof( double ) );
38 A[i*LDA+j]=a[j*(*lda)+i];
42 B = (
double* )malloc( (*k)*LDB*
sizeof( double ) );
45 B[i*LDB+j]=b[j*(*ldb)+i];
49 B = (
double* )malloc( LDB*(*n)*
sizeof( double ) );
52 B[i*LDB+j]=b[j*(*ldb)+i];
55 C = (
double* )malloc( (*m)*LDC*
sizeof( double ) );
58 C[i*LDC+j]=c[j*(*ldc)+i];
61 B, LDB, *beta, C, LDC );
64 c[j*(*ldc)+i]=C[i*LDC+j];
71 b, *ldb, *beta, c, *ldc );
74 b, *ldb, *beta, c, *ldc );
76 void F77_dsymm(
int *layout,
char *rtlf,
char *uplow,
int *m,
int *n,
77 double *alpha,
double *a,
int *lda,
double *b,
int *ldb,
78 double *beta,
double *c,
int *ldc ) {
91 A = (
double* )malloc( (*m)*LDA*
sizeof( double ) );
94 A[i*LDA+j]=a[j*(*lda)+i];
98 A = (
double* )malloc( (*n)*LDA*
sizeof( double ) );
100 for( j=0; j<*n; j++ )
101 A[i*LDA+j]=a[j*(*lda)+i];
104 B = (
double* )malloc( (*m)*LDB*
sizeof( double ) );
105 for( i=0; i<*m; i++ )
106 for( j=0; j<*n; j++ )
107 B[i*LDB+j]=b[j*(*ldb)+i];
109 C = (
double* )malloc( (*m)*LDC*
sizeof( double ) );
110 for( j=0; j<*n; j++ )
111 for( i=0; i<*m; i++ )
112 C[i*LDC+j]=c[j*(*ldc)+i];
113 cblas_dsymm(
CblasRowMajor, side, uplo, *m, *n, *alpha, A, LDA, B, LDB,
115 for( j=0; j<*n; j++ )
116 for( i=0; i<*m; i++ )
117 c[j*(*ldc)+i]=C[i*LDC+j];
123 cblas_dsymm(
CblasColMajor, side, uplo, *m, *n, *alpha, a, *lda, b, *ldb,
126 cblas_dsymm(
UNDEFINED, side, uplo, *m, *n, *alpha, a, *lda, b, *ldb,
130 void F77_dsyrk(
int *layout,
char *uplow,
char *transp,
int *n,
int *k,
131 double *alpha,
double *a,
int *lda,
132 double *beta,
double *c,
int *ldc ) {
145 A = (
double* )malloc( (*n)*LDA*
sizeof( double ) );
146 for( i=0; i<*n; i++ )
147 for( j=0; j<*k; j++ )
148 A[i*LDA+j]=a[j*(*lda)+i];
152 A = (
double* )malloc( (*k)*LDA*
sizeof( double ) );
153 for( i=0; i<*k; i++ )
154 for( j=0; j<*n; j++ )
155 A[i*LDA+j]=a[j*(*lda)+i];
158 C = (
double* )malloc( (*n)*LDC*
sizeof( double ) );
159 for( i=0; i<*n; i++ )
160 for( j=0; j<*n; j++ )
161 C[i*LDC+j]=c[j*(*ldc)+i];
164 for( j=0; j<*n; j++ )
165 for( i=0; i<*n; i++ )
166 c[j*(*ldc)+i]=C[i*LDC+j];
178 void F77_dsyr2k(
int *layout,
char *uplow,
char *transp,
int *n,
int *k,
179 double *alpha,
double *a,
int *lda,
double *b,
int *ldb,
180 double *beta,
double *c,
int *ldc ) {
193 A = (
double* )malloc( (*n)*LDA*
sizeof( double ) );
194 B = (
double* )malloc( (*n)*LDB*
sizeof( double ) );
195 for( i=0; i<*n; i++ )
196 for( j=0; j<*k; j++ ) {
197 A[i*LDA+j]=a[j*(*lda)+i];
198 B[i*LDB+j]=b[j*(*ldb)+i];
204 A = (
double* )malloc( LDA*(*k)*
sizeof( double ) );
205 B = (
double* )malloc( LDB*(*k)*
sizeof( double ) );
206 for( i=0; i<*k; i++ )
207 for( j=0; j<*n; j++ ){
208 A[i*LDA+j]=a[j*(*lda)+i];
209 B[i*LDB+j]=b[j*(*ldb)+i];
213 C = (
double* )malloc( (*n)*LDC*
sizeof( double ) );
214 for( i=0; i<*n; i++ )
215 for( j=0; j<*n; j++ )
216 C[i*LDC+j]=c[j*(*ldc)+i];
218 B, LDB, *beta, C, LDC );
219 for( j=0; j<*n; j++ )
220 for( i=0; i<*n; i++ )
221 c[j*(*ldc)+i]=C[i*LDC+j];
228 b, *ldb, *beta, c, *ldc );
231 b, *ldb, *beta, c, *ldc );
233 void F77_dtrmm(
int *layout,
char *rtlf,
char *uplow,
char *transp,
char *diagn,
234 int *m,
int *n,
double *alpha,
double *a,
int *lda,
double *b,
251 A = (
double* )malloc( (*m)*LDA*
sizeof( double ) );
252 for( i=0; i<*m; i++ )
253 for( j=0; j<*m; j++ )
254 A[i*LDA+j]=a[j*(*lda)+i];
258 A = (
double* )malloc( (*n)*LDA*
sizeof( double ) );
259 for( i=0; i<*n; i++ )
260 for( j=0; j<*n; j++ )
261 A[i*LDA+j]=a[j*(*lda)+i];
264 B = (
double* )malloc( (*m)*LDB*
sizeof( double ) );
265 for( i=0; i<*m; i++ )
266 for( j=0; j<*n; j++ )
267 B[i*LDB+j]=b[j*(*ldb)+i];
270 for( j=0; j<*n; j++ )
271 for( i=0; i<*m; i++ )
272 b[j*(*ldb)+i]=B[i*LDB+j];
284 void F77_dtrsm(
int *layout,
char *rtlf,
char *uplow,
char *transp,
char *diagn,
285 int *m,
int *n,
double *alpha,
double *a,
int *lda,
double *b,
302 A = (
double* )malloc( (*m)*LDA*
sizeof( double ) );
303 for( i=0; i<*m; i++ )
304 for( j=0; j<*m; j++ )
305 A[i*LDA+j]=a[j*(*lda)+i];
309 A = (
double* )malloc( (*n)*LDA*
sizeof( double ) );
310 for( i=0; i<*n; i++ )
311 for( j=0; j<*n; j++ )
312 A[i*LDA+j]=a[j*(*lda)+i];
315 B = (
double* )malloc( (*m)*LDB*
sizeof( double ) );
316 for( i=0; i<*m; i++ )
317 for( j=0; j<*n; j++ )
318 B[i*LDB+j]=b[j*(*ldb)+i];
321 for( j=0; j<*n; j++ )
322 for( i=0; i<*m; i++ )
323 b[j*(*ldb)+i]=B[i*LDB+j];
void cblas_dsyrk(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, CBLAS_TRANSPOSE Trans, const int N, const int K, const double alpha, const double *A, const int lda, const double beta, double *C, const int ldc)
void get_transpose_type(char *type, CBLAS_TRANSPOSE *trans)
void get_side_type(char *type, CBLAS_SIDE *side)
void cblas_dsyr2k(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo, CBLAS_TRANSPOSE Trans, 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)
void cblas_dtrmm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, CBLAS_UPLO Uplo, CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, const int M, const int N, const double alpha, const double *A, const int lda, double *B, const int ldb)
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)
void cblas_dsymm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, CBLAS_UPLO Uplo, const int M, const int N, const double alpha, const double *A, const int lda, const double *B, const int ldb, const double beta, double *C, const int ldc)
void cblas_dtrsm(CBLAS_LAYOUT layout, CBLAS_SIDE Side, CBLAS_UPLO Uplo, CBLAS_TRANSPOSE TransA, CBLAS_DIAG Diag, const int M, const int N, const double alpha, const double *A, const int lda, double *B, const int ldb)
void F77_dsymm(int *layout, char *rtlf, char *uplow, int *m, int *n, double *alpha, double *a, int *lda, double *b, int *ldb, double *beta, double *c, int *ldc)
void F77_dtrsm(int *layout, char *rtlf, char *uplow, char *transp, char *diagn, int *m, int *n, double *alpha, double *a, int *lda, double *b, int *ldb)
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)
void get_diag_type(char *type, CBLAS_DIAG *diag)
void F77_dsyr2k(int *layout, char *uplow, char *transp, int *n, int *k, double *alpha, double *a, int *lda, double *b, int *ldb, double *beta, double *c, int *ldc)
void F77_dsyrk(int *layout, char *uplow, char *transp, int *n, int *k, double *alpha, double *a, int *lda, double *beta, double *c, int *ldc)
void get_uplo_type(char *type, CBLAS_UPLO *uplo)
void F77_dtrmm(int *layout, char *rtlf, char *uplow, char *transp, char *diagn, int *m, int *n, double *alpha, double *a, int *lda, double *b, int *ldb)