LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
cblas_example2.c
Go to the documentation of this file.
1 /* cblas_example2.c */
2 
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include "cblas.h"
6 #include "cblas_f77.h"
7 
8 #define INVALID -1
9 
10 int main (int argc, char **argv )
11 {
12  int rout=-1,info=0,m,n,k,lda,ldb,ldc;
13  double A[2] = {0.0,0.0},
14  B[2] = {0.0,0.0},
15  C[2] = {0.0,0.0},
16  ALPHA=0.0, BETA=0.0;
17 
18  if (argc > 2){
19  rout = atoi(argv[1]);
20  info = atoi(argv[2]);
21  }
22 
23  if (rout == 1) {
24  if (info==0) {
25  printf("Checking if cblas_dgemm fails on parameter 4\n");
27  ALPHA, A, 1, B, 1, BETA, C, 1 );
28  }
29  if (info==1) {
30  printf("Checking if cblas_dgemm fails on parameter 5\n");
32  ALPHA, A, 1, B, 1, BETA, C, 1 );
33  }
34  if (info==2) {
35  printf("Checking if cblas_dgemm fails on parameter 9\n");
37  ALPHA, A, 1, B, 1, BETA, C, 2 );
38  }
39  if (info==3) {
40  printf("Checking if cblas_dgemm fails on parameter 11\n");
42  ALPHA, A, 1, B, 1, BETA, C, 1 );
43  }
44  } else {
45  if (info==0) {
46  printf("Checking if F77_dgemm fails on parameter 3\n");
47  m=INVALID; n=0; k=0; lda=1; ldb=1; ldc=1;
48  F77_dgemm( "T", "N", &m, &n, &k,
49  &ALPHA, A, &lda, B, &ldb, &BETA, C, &ldc );
50  }
51  if (info==1) {
52  m=0; n=INVALID; k=0; lda=1; ldb=1; ldc=1;
53  printf("Checking if F77_dgemm fails on parameter 4\n");
54  F77_dgemm( "N", "T", &m, &n, &k,
55  &ALPHA, A, &lda, B, &ldb, &BETA, C, &ldc );
56  }
57  if (info==2) {
58  printf("Checking if F77_dgemm fails on parameter 8\n");
59  m=2; n=0; k=0; lda=1; ldb=1; ldc=2;
60  F77_dgemm( "N", "N" , &m, &n, &k,
61  &ALPHA, A, &lda, B, &ldb, &BETA, C, &ldc );
62  }
63  if (info==3) {
64  printf("Checking if F77_dgemm fails on parameter 10\n");
65  m=0; n=0; k=2; lda=1; ldb=1; ldc=1;
66  F77_dgemm( "N", "N" , &m, &n, &k,
67  &ALPHA, A, &lda, B, &ldb, &BETA, C, &ldc );
68  }
69  }
70 
71  return 0;
72 }
#define F77_dgemm
Definition: cblas_f77.h:173
int main(int argc, char **argv)
#define INVALID
Definition: cblas_example2.c:8
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