xref: /petsc/include/petscblaslapack.h (revision c6a45a9732aaf0679b0f4eb4ddc75ce99ee9558a)
1 /*
2    This is to provide some name space protection from Lapack and Blas
3 allow the appropriate single or double precision version to be used.
4 Also deals with different Fortran 77 naming conventions on machines.
5 */
6 #if !defined(_PLAPACK_H)
7 #define _PLAPACK_H
8 
9 #include "ptscimpl.h"
10 
11 #if !defined(PETSC_COMPLEX)
12 #if defined(PARCH_cray)
13 #define BLdot_   SDOT
14 #define BLnrm2_  SNRM2
15 #define BLscal_  SSCAL
16 #define BLcopy_  SCOPY
17 #define BLswap_  SSWAP
18 #define BLaxpy_  SAXPY
19 #define BLasum_  SASUM
20 #elif defined(FORTRANCAPS)
21 #define BLdot_   DDOT
22 #define BLnrm2_  DNRM2
23 #define BLscal_  DSCAL
24 #define BLcopy_  DCOPY
25 #define BLswap_  DSWAP
26 #define BLaxpy_  DAXPY
27 #define BLasum_  DASUM
28 #elif !defined(FORTRANUNDERSCORE)
29 #define BLdot_   ddot
30 #define BLnrm2_  dnrm2
31 #define BLscal_  dscal
32 #define BLcopy_  dcopy
33 #define BLswap_  dswap
34 #define BLaxpy_  daxpy
35 #define BLasum_  dasum
36 #else
37 #define BLdot_   ddot_
38 #define BLnrm2_  dnrm2_
39 #define BLscal_  dscal_
40 #define BLcopy_  dcopy_
41 #define BLswap_  dswap_
42 #define BLaxpy_  daxpy_
43 #define BLasum_  dasum_
44 #endif
45 
46 #if defined(PARCH_cray)
47 #define LApotrf_ SPOTRF
48 #define LApotrs_ SPOTRS
49 #define LAgemv_  SGEMV
50 #define LAgetrf_ SGETRF
51 #define LAgetrs_ SGETRS
52 #define LAgemv_  SGEMV
53 #define LAtrmv_  STRMV
54 #define LAtrsl_  STRSL
55 #define LAger_   SGER
56 #elif defined(FORTRANCAPS)
57 #define LApotrf_ DPOTRF
58 #define LApotrs_ DPOTRS
59 #define LAgemv_  DGEMV
60 #define LAgetrf_ DGETRF
61 #define LAgetrs_ DGETRS
62 #define LAger_   DGER
63 #define LAtrmv_  DTRMV
64 #define LAtrsl_  DTRSL
65 #elif !defined(FORTRANUNDERSCORE)
66 #define LApotrf_ dpotrf
67 #define LApotrs_ dpotrs
68 #define LAgemv_  dgemv
69 #define LAgetrf_ dgetrf
70 #define LAgetrs_ dgetrs
71 #define LAger_   dger
72 #define LAtrmv_  dtrmv
73 #define LAtrsl_  dtrsl
74 #else
75 #define LApotrf_ dpotrf_
76 #define LApotrs_ dpotrs_
77 #define LAgemv_  dgemv_
78 #define LAgetrf_ dgetrf_
79 #define LAgetrs_ dgetrs_
80 #define LAger_   dger_
81 #define LAtrmv_  dtrmv_
82 #define LAtrsl_  dtrsl_
83 #endif
84 
85 #else
86 
87 #if defined(PARCH_cray)
88 #define BLdot_   CDOTC
89 #define BLnrm2_  SCNRM2
90 #define BLscal_  CSCAL
91 #define BLcopy_  CCOPY
92 #define BLswap_  CSWAP
93 #define BLaxpy_  CAXPY
94 #define BLasum_  SCASUM
95 #elif defined(FORTRANCAPS)
96 #define BLdot_   ZDOTC
97 #define BLnrm2_  DZNRM2
98 #define BLscal_  ZSCAL
99 #define BLcopy_  ZCOPY
100 #define BLswap_  ZSWAP
101 #define BLaxpy_  ZAXPY
102 #define BLasum_  DZASUM
103 #elif !defined(FORTRANUNDERSCORE)
104 #define BLdot_   zdotc
105 #define BLnrm2_  dznrm2
106 #define BLscal_  zscal
107 #define BLcopy_  zcopy
108 #define BLswap_  zswap
109 #define BLaxpy_  zaxpy
110 #define BLasum_  dzasum
111 #else
112 #define BLdot_   zdotc_
113 #define BLnrm2_  dznrm2_
114 #define BLscal_  zscal_
115 #define BLcopy_  zcopy_
116 #define BLswap_  zswap_
117 #define BLaxpy_  zaxpy_
118 #define BLasum_  dzasum_
119 #endif
120 
121 #if defined(PARCH_cray)
122 #define LApotrf_ CPOTRF
123 #define LApotrs_ CPOTRS
124 #define LAgemv_  CGEMV
125 #define LAgetrf_ CGETRF
126 #define LAgetrs_ CGETRS
127 #define LAgemv_  CGEMV
128 #define LAtrmv_  CTRMV
129 #define LAtrsl_  CTRSL
130 #define LAger_   CGER
131 #elif defined(FORTRANCAPS)
132 #define LApotrf_ ZPOTRF
133 #define LApotrs_ ZPOTRS
134 #define LAgemv_  ZGEMV
135 #define LAgetrf_ ZGETRF
136 #define LAgetrs_ ZGETRS
137 #define LAger_   ZGER
138 #define LAtrmv_  ZTRMV
139 #define LAtrsl_  ZTRSL
140 #elif !defined(FORTRANUNDERSCORE)
141 #define LApotrf_ zpotrf
142 #define LApotrs_ zpotrs
143 #define LAgemv_  zgemv
144 #define LAgetrf_ zgetrf
145 #define LAgetrs_ zgetrs
146 #define LAger_   zger
147 #define LAtrmv_  ztrmv
148 #define LAtrsl_  ztrsl
149 #else
150 #define LApotrf_ zpotrf_
151 #define LApotrs_ zpotrs_
152 #define LAgemv_  zgemv_
153 #define LAgetrf_ zgetrf_
154 #define LAgetrs_ zgetrs_
155 #define LAger_   zger_
156 #define LAtrmv_  ztrmv_
157 #define LAtrsl_  ztrsl_
158 #endif
159 
160 #endif
161 
162 #if defined(__cplusplus)
163 extern "C" {
164 #endif
165 
166 extern Scalar BLdot_(int*,Scalar*,int*,Scalar*,int*);
167 extern double BLnrm2_(int*,Scalar*,int*),BLasum_(int*,Scalar*,int*);
168 extern void   BLscal_(int*,Scalar*,Scalar*,int*);
169 extern void   BLcopy_(int*,Scalar*,int*,Scalar*,int*);
170 extern void   BLswap_(int*,Scalar*,int*,Scalar*,int*);
171 extern void   BLaxpy_(int*,Scalar*,Scalar*,int*,Scalar*,int*);
172 
173 extern void   LAgetrf_(int*,int*,Scalar*,int*,int*,int*);
174 extern void   LApotrf_(char*,int*,Scalar*,int*,int*);
175 extern void   LAgemv_(char*,int*,int*,Scalar*,Scalar*,int*,Scalar *,int*,
176                Scalar*,Scalar*,int*);
177 extern void   LApotrs_(char*,int*,int*,Scalar*,int*,Scalar*,int*,int*);
178 extern void   LAgetrs_(char*,int*,int*,Scalar*,int*,int*,Scalar*,int*,int*);
179 
180 #if defined(__cplusplus)
181 };
182 #endif
183 
184 #endif
185