1 #include "blis.h"
2 #ifdef BLIS_ENABLE_CBLAS
3 /*
4 *
5 * cblas_zsymm.c
6 * This program is a C interface to zsymm.
7 * Written by Keita Teranishi
8 * 4/8/1998
9 *
10 */
11
12 #include "cblas.h"
13 #include "cblas_f77.h"
cblas_zsymm(enum CBLAS_ORDER Order,enum CBLAS_SIDE Side,enum CBLAS_UPLO Uplo,f77_int M,f77_int N,const void * alpha,const void * A,f77_int lda,const void * B,f77_int ldb,const void * beta,void * C,f77_int ldc)14 void cblas_zsymm(enum CBLAS_ORDER Order, enum CBLAS_SIDE Side,
15 enum CBLAS_UPLO Uplo, f77_int M, f77_int N,
16 const void *alpha, const void *A, f77_int lda,
17 const void *B, f77_int ldb, const void *beta,
18 void *C, f77_int ldc)
19 {
20 char SD, UL;
21 #ifdef F77_CHAR
22 F77_CHAR F77_SD, F77_UL;
23 #else
24 #define F77_SD &SD
25 #define F77_UL &UL
26 #endif
27
28 #ifdef F77_INT
29 F77_INT F77_M=M, F77_N=N, F77_lda=lda, F77_ldb=ldb;
30 F77_INT F77_ldc=ldc;
31 #else
32 #define F77_M M
33 #define F77_N N
34 #define F77_lda lda
35 #define F77_ldb ldb
36 #define F77_ldc ldc
37 #endif
38
39 extern int CBLAS_CallFromC;
40 extern int RowMajorStrg;
41 RowMajorStrg = 0;
42 CBLAS_CallFromC = 1;
43
44 if( Order == CblasColMajor )
45 {
46 if( Side == CblasRight) SD='R';
47 else if ( Side == CblasLeft ) SD='L';
48 else
49 {
50 cblas_xerbla(2, "cblas_zsymm", "Illegal Side setting, %d\n", Side);
51 CBLAS_CallFromC = 0;
52 RowMajorStrg = 0;
53 return;
54 }
55
56 if( Uplo == CblasUpper) UL='U';
57 else if ( Uplo == CblasLower ) UL='L';
58 else
59 {
60 cblas_xerbla(3, "cblas_zsymm", "Illegal Uplo setting, %d\n", Uplo);
61 CBLAS_CallFromC = 0;
62 RowMajorStrg = 0;
63 return;
64 }
65
66 #ifdef F77_CHAR
67 F77_UL = C2F_CHAR(&UL);
68 F77_SD = C2F_CHAR(&SD);
69 #endif
70
71 F77_zsymm(F77_SD, F77_UL, &F77_M, &F77_N, (dcomplex*)alpha, (dcomplex*)A, &F77_lda,
72 (dcomplex*)B, &F77_ldb, (dcomplex*)beta, (dcomplex*)C, &F77_ldc);
73 } else if (Order == CblasRowMajor)
74 {
75 RowMajorStrg = 1;
76 if( Side == CblasRight) SD='L';
77 else if ( Side == CblasLeft ) SD='R';
78 else
79 {
80 cblas_xerbla(2, "cblas_zsymm", "Illegal Side setting, %d\n", Side);
81 CBLAS_CallFromC = 0;
82 RowMajorStrg = 0;
83 return;
84 }
85
86 if( Uplo == CblasUpper) UL='L';
87 else if ( Uplo == CblasLower ) UL='U';
88 else
89 {
90 cblas_xerbla(3, "cblas_zsymm", "Illegal Uplo setting, %d\n", Uplo);
91 CBLAS_CallFromC = 0;
92 RowMajorStrg = 0;
93 return;
94 }
95
96 #ifdef F77_CHAR
97 F77_UL = C2F_CHAR(&UL);
98 F77_SD = C2F_CHAR(&SD);
99 #endif
100
101 F77_zsymm(F77_SD, F77_UL, &F77_N, &F77_M, (dcomplex*)alpha, (dcomplex*)A, &F77_lda,
102 (dcomplex*)B, &F77_ldb, (dcomplex*)beta, (dcomplex*)C, &F77_ldc);
103 }
104 else cblas_xerbla(1, "cblas_zsymm", "Illegal Order setting, %d\n", Order);
105 CBLAS_CallFromC = 0;
106 RowMajorStrg = 0;
107 return;
108 }
109 #endif
110