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