LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
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
10int main (int argc, char **argv )
11{
12 CBLAS_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}
@ CblasNoTrans
Definition cblas.h:40
@ CblasTrans
Definition cblas.h:40
@ CblasRowMajor
Definition cblas.h:39
#define CBLAS_INT
Definition cblas.h:24
void cblas_dgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA, CBLAS_TRANSPOSE TransB, const CBLAS_INT M, const CBLAS_INT N, const CBLAS_INT K, const double alpha, const double *A, const CBLAS_INT lda, const double *B, const CBLAS_INT ldb, const double beta, double *C, const CBLAS_INT ldc)
Definition cblas_dgemm.c:12
int main()
#define INVALID
#define F77_dgemm(...)
Definition cblas_f77.h:396