44 #ifndef _TEUCHOS_BLAS_WRAPPERS_HPP_
45 #define _TEUCHOS_BLAS_WRAPPERS_HPP_
50 #pragma warning ( disable : 4190 )
60 #if defined(INTEL_CXML)
61 # define PREFIX __stdcall
62 # define Teuchos_fcd const char *, unsigned int
63 #elif defined(INTEL_MKL)
65 # define Teuchos_fcd const char *
68 # define Teuchos_fcd const char *
75 #define DROTG_F77 F77_BLAS_MANGLE(drotg,DROTG)
76 #define DROT_F77 F77_BLAS_MANGLE(drot,DROT)
77 #define DASUM_F77 F77_BLAS_MANGLE(dasum,DASUM)
78 #define DAXPY_F77 F77_BLAS_MANGLE(daxpy,DAXPY)
79 #define DCOPY_F77 F77_BLAS_MANGLE(dcopy,DCOPY)
80 #define DDOT_F77 F77_BLAS_MANGLE(ddot,DDOT)
81 #define DNRM2_F77 F77_BLAS_MANGLE(dnrm2,DNRM2)
82 #define DSCAL_F77 F77_BLAS_MANGLE(dscal,DSCAL)
83 #define IDAMAX_F77 F77_BLAS_MANGLE(idamax,IDAMAX)
84 #define DGEMV_F77 F77_BLAS_MANGLE(dgemv,DGEMV)
85 #define DGER_F77 F77_BLAS_MANGLE(dger,DGER)
86 #define DTRMV_F77 F77_BLAS_MANGLE(dtrmv,DTRMV)
87 #define DGEMM_F77 F77_BLAS_MANGLE(dgemm,DGEMM)
88 #define DSWAP_F77 F77_BLAS_MANGLE(dswap,DSWAP)
89 #define DSYMM_F77 F77_BLAS_MANGLE(dsymm,DSYMM)
90 #define DSYRK_F77 F77_BLAS_MANGLE(dsyrk,DSYRK)
91 #define DTRMM_F77 F77_BLAS_MANGLE(dtrmm,DTRMM)
92 #define DTRSM_F77 F77_BLAS_MANGLE(dtrsm,DTRSM)
94 #ifdef HAVE_TEUCHOS_COMPLEX
96 #define ZROTG_F77 F77_BLAS_MANGLE(zrotg,ZROTG)
97 #define ZROT_F77 F77_BLAS_MANGLE(zrot,ZROT)
98 #define ZASUM_F77 F77_BLAS_MANGLE(dzasum,DZASUM)
99 #define ZAXPY_F77 F77_BLAS_MANGLE(zaxpy,ZAXPY)
100 #define ZCOPY_F77 F77_BLAS_MANGLE(zcopy,ZCOPY)
101 #define ZDOT_F77 F77_BLAS_MANGLE(zdotc,ZDOTC)
102 #define ZNRM2_F77 F77_BLAS_MANGLE(dznrm2,DZNRM2)
103 #define ZSCAL_F77 F77_BLAS_MANGLE(zscal,ZSCAL)
104 #define IZAMAX_F77 F77_BLAS_MANGLE(izamax,IZAMAX)
105 #define ZGEMV_F77 F77_BLAS_MANGLE(zgemv,ZGEMV)
106 #define ZGER_F77 F77_BLAS_MANGLE(zgeru,ZGERU)
107 #define ZTRMV_F77 F77_BLAS_MANGLE(ztrmv,ZTRMV)
108 #define ZGEMM_F77 F77_BLAS_MANGLE(zgemm,ZGEMM)
109 #define ZSWAP_F77 F77_BLAS_MANGLE(zswap,ZSWAP)
110 #define ZSYMM_F77 F77_BLAS_MANGLE(zsymm,ZSYMM)
111 #define ZSYRK_F77 F77_BLAS_MANGLE(zsyrk,ZSYRK)
112 #define ZHERK_F77 F77_BLAS_MANGLE(zherk,ZHERK)
113 #define ZTRMM_F77 F77_BLAS_MANGLE(ztrmm,ZTRMM)
114 #define ZTRSM_F77 F77_BLAS_MANGLE(ztrsm,ZTRSM)
118 #define SROTG_F77 F77_BLAS_MANGLE(srotg,SROTG)
119 #define SROT_F77 F77_BLAS_MANGLE(srot,SROT)
120 #define SSCAL_F77 F77_BLAS_MANGLE(sscal,SSCAL)
121 #define SCOPY_F77 F77_BLAS_MANGLE(scopy,SCOPY)
122 #define SAXPY_F77 F77_BLAS_MANGLE(saxpy,SAXPY)
123 #define SDOT_F77 F77_BLAS_MANGLE(sdot,SDOT)
124 #define SNRM2_F77 F77_BLAS_MANGLE(snrm2,SNRM2)
125 #define SASUM_F77 F77_BLAS_MANGLE(sasum,SASUM)
126 #define ISAMAX_F77 F77_BLAS_MANGLE(isamax,ISAMAX)
127 #define SGEMV_F77 F77_BLAS_MANGLE(sgemv,SGEMV)
128 #define SGER_F77 F77_BLAS_MANGLE(sger,SGER)
129 #define STRMV_F77 F77_BLAS_MANGLE(strmv,STRMV)
130 #define SGEMM_F77 F77_BLAS_MANGLE(sgemm,SGEMM)
131 #define SSWAP_F77 F77_BLAS_MANGLE(sswap,SSWAP)
132 #define SSYMM_F77 F77_BLAS_MANGLE(ssymm,SSYMM)
133 #define SSYRK_F77 F77_BLAS_MANGLE(ssyrk,SSYRK)
134 #define STRMM_F77 F77_BLAS_MANGLE(strmm,STRMM)
135 #define STRSM_F77 F77_BLAS_MANGLE(strsm,STRSM)
137 #ifdef HAVE_TEUCHOS_COMPLEX
139 #define CROTG_F77 F77_BLAS_MANGLE(crotg,CROTG)
140 #define CROT_F77 F77_BLAS_MANGLE(crot,CROT)
141 #define SCASUM_F77 F77_BLAS_MANGLE(scasum,SCASUM)
142 #define CAXPY_F77 F77_BLAS_MANGLE(caxpy,CAXPY)
143 #define CCOPY_F77 F77_BLAS_MANGLE(ccopy,CCOPY)
144 #define CDOT_F77 F77_BLAS_MANGLE(cdotc,CDOTC)
145 #define SCNRM2_F77 F77_BLAS_MANGLE(scnrm2,SCNRM2)
146 #define CSCAL_F77 F77_BLAS_MANGLE(cscal,CSCAL)
147 #define ICAMAX_F77 F77_BLAS_MANGLE(icamax,ICAMAX)
148 #define CGEMV_F77 F77_BLAS_MANGLE(cgemv,CGEMV)
149 #define CGER_F77 F77_BLAS_MANGLE(cgeru,CGERU)
150 #define CTRMV_F77 F77_BLAS_MANGLE(ctrmv,CTRMV)
151 #define CGEMM_F77 F77_BLAS_MANGLE(cgemm,CGEMM)
152 #define CSWAP_F77 F77_BLAS_MANGLE(cswap,CSWAP)
153 #define CSYMM_F77 F77_BLAS_MANGLE(csymm,CSYMM)
154 #define CSYRK_F77 F77_BLAS_MANGLE(csyrk,CSYRK)
155 #define CHERK_F77 F77_BLAS_MANGLE(cherk,CHERK)
156 #define CTRMM_F77 F77_BLAS_MANGLE(ctrmm,CTRMM)
157 #define CTRSM_F77 F77_BLAS_MANGLE(ctrsm,CTRSM)
171 void PREFIX DROT_F77(
const int*
n,
double* dx,
const int* incx,
double* dy,
const int* incy,
double* c,
double* s);
172 double PREFIX DASUM_F77(
const int* n,
const double x[],
const int* incx);
173 void PREFIX DAXPY_F77(
const int* n,
const double* alpha,
const double x[],
const int* incx,
double y[],
const int* incy);
174 void PREFIX DCOPY_F77(
const int* n,
const double *x,
const int* incx,
double *y,
const int* incy);
175 double PREFIX DDOT_F77(
const int* n,
const double x[],
const int* incx,
const double y[],
const int* incy);
176 double PREFIX DNRM2_F77(
const int* n,
const double x[],
const int* incx);
177 void PREFIX DSCAL_F77(
const int* n,
const double* alpha,
double *x,
const int* incx);
178 void PREFIX DSWAP_F77(
const int*
const n,
double*
const x,
const int*
const incx,
179 double*
const y,
const int*
const incy);
183 #if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus)
185 # if defined(HAVE_COMPLEX_BLAS_PROBLEM)
186 # if defined(HAVE_FIXABLE_COMPLEX_BLAS_PROBLEM)
187 void PREFIX ZDOT_F77(std::complex<double> *ret,
const int* n,
const std::complex<double> x[],
const int* incx,
const std::complex<double> y[],
const int* incy);
188 # elif defined(HAVE_VECLIB_COMPLEX_BLAS)
190 # include <vecLib/cblas.h>
196 # endif // HAVE_COMPLEX_BLAS_PROBLEM
198 std::complex<double>
PREFIX ZDOT_F77(
const int* n,
const std::complex<double> x[],
const int* incx,
const std::complex<double> y[],
const int* incy);
199 # endif // defined(HAVE_COMPLEX_BLAS_PROBLEM)
201 double PREFIX ZNRM2_F77(
const int* n,
const std::complex<double> x[],
const int* incx);
202 double PREFIX ZASUM_F77(
const int* n,
const std::complex<double> x[],
const int* incx);
203 void PREFIX ZROTG_F77(std::complex<double>* da, std::complex<double>* db,
double* c, std::complex<double>* s);
204 void PREFIX ZROT_F77(
const int* n, std::complex<double>* dx,
const int* incx, std::complex<double>* dy,
const int* incy,
double* c, std::complex<double>* s);
205 void PREFIX ZAXPY_F77(
const int* n,
const std::complex<double>* alpha,
const std::complex<double> x[],
const int* incx, std::complex<double> y[],
const int* incy);
206 void PREFIX ZCOPY_F77(
const int* n,
const std::complex<double> *x,
const int* incx, std::complex<double> *y,
const int* incy);
207 void PREFIX ZSCAL_F77(
const int* n,
const std::complex<double>* alpha, std::complex<double> *x,
const int* incx);
208 void PREFIX ZSWAP_F77(
const int*
const n, std::complex<double>*
const x,
const int*
const incx,
209 std::complex<double>*
const y,
const int*
const incy);
210 int PREFIX IZAMAX_F77(
const int* n,
const std::complex<double> *x,
const int* incx);
215 #ifdef HAVE_TEUCHOS_BLASFLOAT
216 # ifdef HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX
217 # include <vecLib/cblas.h>
218 # elif defined(HAVE_TEUCHOS_BLASFLOAT_DOUBLE_RETURN)
219 double PREFIX SASUM_F77(
const int* n,
const float x[],
const int* incx);
220 double PREFIX SDOT_F77(
const int* n,
const float x[],
const int* incx,
const float y[],
const int* incy);
221 double PREFIX SNRM2_F77(
const int* n,
const float x[],
const int* incx);
223 float PREFIX SASUM_F77(
const int* n,
const float x[],
const int* incx);
224 float PREFIX SDOT_F77(
const int* n,
const float x[],
const int* incx,
const float y[],
const int* incy);
225 float PREFIX SNRM2_F77(
const int* n,
const float x[],
const int* incx);
226 # endif // which blasfloat
227 #endif // ifdef blasfloat
229 void PREFIX SROT_F77(
const int* n,
float* dx,
const int* incx,
float* dy,
const int* incy,
float* c,
float* s);
230 void PREFIX SAXPY_F77(
const int* n,
const float* alpha,
const float x[],
const int* incx,
float y[],
const int* incy);
231 void PREFIX SCOPY_F77(
const int* n,
const float *x,
const int* incx,
float *y,
const int* incy);
232 void PREFIX SSCAL_F77(
const int* n,
const float* alpha,
float *x,
const int* incx);
233 void PREFIX SSWAP_F77(
const int*
const n,
float*
const x,
const int*
const incx,
234 float*
const y,
const int*
const incy);
238 #if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus)
239 # if defined(HAVE_TEUCHOS_BLASFLOAT)
240 # if defined(HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX)
242 # include <vecLib/cblas.h>
243 # elif defined(HAVE_TEUCHOS_BLASFLOAT_DOUBLE_RETURN)
244 double PREFIX SCASUM_F77(
const int* n,
const std::complex<float> x[],
const int* incx);
245 double PREFIX SCNRM2_F77(
const int* n,
const std::complex<float> x[],
const int* incx);
247 float PREFIX SCASUM_F77(
const int* n,
const std::complex<float> x[],
const int* incx);
248 float PREFIX SCNRM2_F77(
const int* n,
const std::complex<float> x[],
const int* incx);
249 # endif // Whether or not we have the veclib bugfix
250 #endif // defined(HAVE_TEUCHOS_BLASFLOAT)
252 #if defined(HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX)
254 #include <vecLib/cblas.h>
255 #elif defined(HAVE_COMPLEX_BLAS_PROBLEM) && defined(HAVE_FIXABLE_COMPLEX_BLAS_PROBLEM)
256 void PREFIX CDOT_F77(std::complex<float> *ret,
const int* n,
const std::complex<float> x[],
const int* incx,
const std::complex<float> y[],
const int* incy);
257 #elif defined(HAVE_TEUCHOS_BLASFLOAT)
258 std::complex<float>
PREFIX CDOT_F77(
const int* n,
const std::complex<float> x[],
const int* incx,
const std::complex<float> y[],
const int* incy);
263 void PREFIX CROTG_F77(std::complex<float>* da, std::complex<float>* db,
float* c, std::complex<float>* s);
264 void PREFIX CROT_F77(
const int* n, std::complex<float>* dx,
const int* incx, std::complex<float>* dy,
const int* incy,
float* c, std::complex<float>* s);
265 void PREFIX CAXPY_F77(
const int* n,
const std::complex<float>* alpha,
const std::complex<float> x[],
const int* incx, std::complex<float> y[],
const int* incy);
266 void PREFIX CCOPY_F77(
const int* n,
const std::complex<float> *x,
const int* incx, std::complex<float> *y,
const int* incy);
267 void PREFIX CSCAL_F77(
const int* n,
const std::complex<float>* alpha, std::complex<float> *x,
const int* incx);
268 void PREFIX CSWAP_F77(
const int*
const n, std::complex<float>*
const x,
const int*
const incx,
269 std::complex<float>*
const y,
const int*
const incy);
270 int PREFIX ICAMAX_F77(
const int* n,
const std::complex<float> *x,
const int* incx);
276 const double x[],
const int* incx,
const double* beta,
double y[],
const int* incy);
278 const double *a,
const int *lda,
double *x,
const int *incx);
279 void PREFIX DGER_F77(
const int *m,
const int *n,
const double *alpha,
const double *x,
const int *incx,
const double *y,
280 const int *incy,
double *a,
const int *lda);
283 #if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus)
285 void PREFIX ZGEMV_F77(
Teuchos_fcd,
const int* m,
const int* n,
const std::complex<double>* alpha,
const std::complex<double> A[],
const int* lda,
286 const std::complex<double> x[],
const int* incx,
const std::complex<double>* beta, std::complex<double> y[],
const int* incy);
288 const std::complex<double> *a,
const int *lda, std::complex<double> *x,
const int *incx);
289 void PREFIX ZGER_F77(
const int *m,
const int *n,
const std::complex<double> *alpha,
const std::complex<double> *x,
const int *incx,
const std::complex<double> *y,
290 const int *incy, std::complex<double> *a,
const int *lda);
296 const float x[],
const int* incx,
const float* beta,
float y[],
const int* incy);
298 const float *a,
const int *lda,
float *x,
const int *incx);
299 void PREFIX SGER_F77(
const int *m,
const int *n,
const float *alpha,
const float *x,
const int *incx,
const float *y,
300 const int *incy,
float *a,
const int *lda);
303 #if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus)
305 void PREFIX CGEMV_F77(
Teuchos_fcd,
const int* m,
const int* n,
const std::complex<float>* alpha,
const std::complex<float> A[],
const int* lda,
306 const std::complex<float> x[],
const int* incx,
const std::complex<float>* beta, std::complex<float> y[],
const int* incy);
308 const std::complex<float> *a,
const int *lda, std::complex<float> *x,
const int *incx);
309 void PREFIX CGER_F77(
const int *m,
const int *n,
const std::complex<float> *alpha,
const std::complex<float> *x,
const int *incx,
const std::complex<float> *y,
310 const int *incy, std::complex<float> *a,
const int *lda);
316 n,
const int *k,
const double *alpha,
const double *a,
const int *lda,
317 const double *b,
const int *ldb,
const double *beta,
double *c,
const int *ldc);
319 const double *alpha,
const double *a,
const int *lda,
320 const double *b,
const int *ldb,
const double *beta,
double *c,
const int *ldc);
322 const double *alpha,
const double *a,
const int *lda,
323 const double *beta,
double *c,
const int *ldc);
325 const int *m,
const int *n,
const double *alpha,
const double *a,
const int * lda,
double *b,
const int *ldb);
327 const int *m,
const int *n,
const double *alpha,
const double *a,
const int *
328 lda,
double *b,
const int *ldb);
331 #if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus)
334 n,
const int *k,
const std::complex<double> *alpha,
const std::complex<double> *a,
const int *lda,
335 const std::complex<double> *b,
const int *ldb,
const std::complex<double> *beta, std::complex<double> *c,
const int *ldc);
337 const std::complex<double> *alpha,
const std::complex<double> *a,
const int *lda,
338 const std::complex<double> *b,
const int *ldb,
const std::complex<double> *beta, std::complex<double> *c,
const int *ldc);
340 const std::complex<double> *alpha,
const std::complex<double> *a,
const int *lda,
341 const std::complex<double> *beta, std::complex<double> *c,
const int *ldc);
343 const std::complex<double> *alpha,
const std::complex<double> *a,
const int *lda,
344 const std::complex<double> *beta, std::complex<double> *c,
const int *ldc);
346 const int *m,
const int *n,
const std::complex<double> *alpha,
const std::complex<double> *a,
const int * lda, std::complex<double> *b,
const int *ldb);
348 const int *m,
const int *n,
const std::complex<double> *alpha,
const std::complex<double> *a,
const int *
349 lda, std::complex<double> *b,
const int *ldb);
355 n,
const int *k,
const float *alpha,
const float *a,
const int *lda,
356 const float *b,
const int *ldb,
const float *beta,
float *c,
const int *ldc);
358 const float *alpha,
const float *a,
const int *lda,
359 const float *b,
const int *ldb,
const float *beta,
float *c,
const int *ldc);
361 const float *alpha,
const float *a,
const int *lda,
362 const float *beta,
float *c,
const int *ldc);
364 const int *m,
const int *n,
const float *alpha,
const float *a,
const int * lda,
float *b,
const int *ldb);
366 const int *m,
const int *n,
const float *alpha,
const float *a,
const int *
367 lda,
float *b,
const int *ldb);
371 #if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus)
374 n,
const int *k,
const std::complex<float> *alpha,
const std::complex<float> *a,
const int *lda,
375 const std::complex<float> *b,
const int *ldb,
const std::complex<float> *beta, std::complex<float> *c,
const int *ldc);
377 const std::complex<float> *alpha,
const std::complex<float> *a,
const int *lda,
378 const std::complex<float> *b,
const int *ldb,
const std::complex<float> *beta, std::complex<float> *c,
const int *ldc);
380 const int *m,
const int *n,
const std::complex<float> *alpha,
const std::complex<float> *a,
const int * lda, std::complex<float> *b,
const int *ldb);
382 const std::complex<float> *alpha,
const std::complex<float> *a,
const int *lda,
383 const std::complex<float> *beta, std::complex<float> *c,
const int *ldc);
385 const std::complex<float> *alpha,
const std::complex<float> *a,
const int *lda,
386 const std::complex<float> *beta, std::complex<float> *c,
const int *ldc);
388 const int *m,
const int *n,
const std::complex<float> *alpha,
const std::complex<float> *a,
const int *
389 lda, std::complex<float> *b,
const int *ldb);
Teuchos header file which uses auto-configuration information to include necessary C++ headers...