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 *
74#if ( defined(_MSC_VER) )
75#define Teuchos_Complex_double_type_name std::complex<double>
76#define Teuchos_Complex_float_type_name std::complex<float>
78#define Teuchos_Complex_double_type_name double _Complex
79#define Teuchos_Complex_float_type_name float _Complex
86#define DROTG_F77 F77_BLAS_MANGLE(drotg,DROTG)
87#define DROT_F77 F77_BLAS_MANGLE(drot,DROT)
88#define DASUM_F77 F77_BLAS_MANGLE(dasum,DASUM)
89#define DAXPY_F77 F77_BLAS_MANGLE(daxpy,DAXPY)
90#define DCOPY_F77 F77_BLAS_MANGLE(dcopy,DCOPY)
91#define DDOT_F77 F77_BLAS_MANGLE(ddot,DDOT)
92#define DNRM2_F77 F77_BLAS_MANGLE(dnrm2,DNRM2)
93#define DSCAL_F77 F77_BLAS_MANGLE(dscal,DSCAL)
94#define IDAMAX_F77 F77_BLAS_MANGLE(idamax,IDAMAX)
95#define DGEMV_F77 F77_BLAS_MANGLE(dgemv,DGEMV)
96#define DGER_F77 F77_BLAS_MANGLE(dger,DGER)
97#define DTRMV_F77 F77_BLAS_MANGLE(dtrmv,DTRMV)
98#define DGEMM_F77 F77_BLAS_MANGLE(dgemm,DGEMM)
99#define DSWAP_F77 F77_BLAS_MANGLE(dswap,DSWAP)
100#define DSYMM_F77 F77_BLAS_MANGLE(dsymm,DSYMM)
101#define DSYRK_F77 F77_BLAS_MANGLE(dsyrk,DSYRK)
102#define DTRMM_F77 F77_BLAS_MANGLE(dtrmm,DTRMM)
103#define DTRSM_F77 F77_BLAS_MANGLE(dtrsm,DTRSM)
105#ifdef HAVE_TEUCHOS_COMPLEX
107#define ZROTG_F77 F77_BLAS_MANGLE(zrotg,ZROTG)
108#define ZROT_F77 F77_BLAS_MANGLE(zrot,ZROT)
109#define ZASUM_F77 F77_BLAS_MANGLE(dzasum,DZASUM)
110#define ZAXPY_F77 F77_BLAS_MANGLE(zaxpy,ZAXPY)
111#define ZCOPY_F77 F77_BLAS_MANGLE(zcopy,ZCOPY)
112#define ZDOT_F77 F77_BLAS_MANGLE(zdotc,ZDOTC)
113#define ZNRM2_F77 F77_BLAS_MANGLE(dznrm2,DZNRM2)
114#define ZSCAL_F77 F77_BLAS_MANGLE(zscal,ZSCAL)
115#define IZAMAX_F77 F77_BLAS_MANGLE(izamax,IZAMAX)
116#define ZGEMV_F77 F77_BLAS_MANGLE(zgemv,ZGEMV)
117#define ZGER_F77 F77_BLAS_MANGLE(zgeru,ZGERU)
118#define ZTRMV_F77 F77_BLAS_MANGLE(ztrmv,ZTRMV)
119#define ZGEMM_F77 F77_BLAS_MANGLE(zgemm,ZGEMM)
120#define ZSWAP_F77 F77_BLAS_MANGLE(zswap,ZSWAP)
121#define ZSYMM_F77 F77_BLAS_MANGLE(zsymm,ZSYMM)
122#define ZSYRK_F77 F77_BLAS_MANGLE(zsyrk,ZSYRK)
123#define ZHERK_F77 F77_BLAS_MANGLE(zherk,ZHERK)
124#define ZTRMM_F77 F77_BLAS_MANGLE(ztrmm,ZTRMM)
125#define ZTRSM_F77 F77_BLAS_MANGLE(ztrsm,ZTRSM)
129#define SROTG_F77 F77_BLAS_MANGLE(srotg,SROTG)
130#define SROT_F77 F77_BLAS_MANGLE(srot,SROT)
131#define SSCAL_F77 F77_BLAS_MANGLE(sscal,SSCAL)
132#define SCOPY_F77 F77_BLAS_MANGLE(scopy,SCOPY)
133#define SAXPY_F77 F77_BLAS_MANGLE(saxpy,SAXPY)
134#define SDOT_F77 F77_BLAS_MANGLE(sdot,SDOT)
135#define SNRM2_F77 F77_BLAS_MANGLE(snrm2,SNRM2)
136#define SASUM_F77 F77_BLAS_MANGLE(sasum,SASUM)
137#define ISAMAX_F77 F77_BLAS_MANGLE(isamax,ISAMAX)
138#define SGEMV_F77 F77_BLAS_MANGLE(sgemv,SGEMV)
139#define SGER_F77 F77_BLAS_MANGLE(sger,SGER)
140#define STRMV_F77 F77_BLAS_MANGLE(strmv,STRMV)
141#define SGEMM_F77 F77_BLAS_MANGLE(sgemm,SGEMM)
142#define SSWAP_F77 F77_BLAS_MANGLE(sswap,SSWAP)
143#define SSYMM_F77 F77_BLAS_MANGLE(ssymm,SSYMM)
144#define SSYRK_F77 F77_BLAS_MANGLE(ssyrk,SSYRK)
145#define STRMM_F77 F77_BLAS_MANGLE(strmm,STRMM)
146#define STRSM_F77 F77_BLAS_MANGLE(strsm,STRSM)
148#ifdef HAVE_TEUCHOS_COMPLEX
150#define CROTG_F77 F77_BLAS_MANGLE(crotg,CROTG)
151#define CROT_F77 F77_BLAS_MANGLE(crot,CROT)
152#define SCASUM_F77 F77_BLAS_MANGLE(scasum,SCASUM)
153#define CAXPY_F77 F77_BLAS_MANGLE(caxpy,CAXPY)
154#define CCOPY_F77 F77_BLAS_MANGLE(ccopy,CCOPY)
155#define CDOT_F77 F77_BLAS_MANGLE(cdotc,CDOTC)
156#define SCNRM2_F77 F77_BLAS_MANGLE(scnrm2,SCNRM2)
157#define CSCAL_F77 F77_BLAS_MANGLE(cscal,CSCAL)
158#define ICAMAX_F77 F77_BLAS_MANGLE(icamax,ICAMAX)
159#define CGEMV_F77 F77_BLAS_MANGLE(cgemv,CGEMV)
160#define CGER_F77 F77_BLAS_MANGLE(cgeru,CGERU)
161#define CTRMV_F77 F77_BLAS_MANGLE(ctrmv,CTRMV)
162#define CGEMM_F77 F77_BLAS_MANGLE(cgemm,CGEMM)
163#define CSWAP_F77 F77_BLAS_MANGLE(cswap,CSWAP)
164#define CSYMM_F77 F77_BLAS_MANGLE(csymm,CSYMM)
165#define CSYRK_F77 F77_BLAS_MANGLE(csyrk,CSYRK)
166#define CHERK_F77 F77_BLAS_MANGLE(cherk,CHERK)
167#define CTRMM_F77 F77_BLAS_MANGLE(ctrmm,CTRMM)
168#define CTRSM_F77 F77_BLAS_MANGLE(ctrsm,CTRSM)
169#define TEUCHOS_BLAS_CONVERT_COMPLEX_FORTRAN_TO_CXX(TYPE, Z) \
170 reinterpret_cast<std::complex<TYPE>&>(Z);
185void PREFIX DROT_F77(
const int* n,
double* dx,
const int* incx,
double* dy,
const int* incy,
double* c,
double* s);
187void PREFIX DAXPY_F77(
const int* n,
const double* alpha,
const double x[],
const int* incx,
double y[],
const int* incy);
188void PREFIX DCOPY_F77(
const int* n,
const double *x,
const int* incx,
double *y,
const int* incy);
189double PREFIX DDOT_F77(
const int* n,
const double x[],
const int* incx,
const double y[],
const int* incy);
193 double*
const y,
const int*
const incy);
197#if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus)
199# if defined(HAVE_COMPLEX_BLAS_PROBLEM)
200# if defined(HAVE_FIXABLE_COMPLEX_BLAS_PROBLEM)
201void 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);
202# elif defined(HAVE_VECLIB_COMPLEX_BLAS)
204# include <vecLib/cblas.h>
215double PREFIX ZNRM2_F77(
const int* n,
const std::complex<double> x[],
const int* incx);
216double PREFIX ZASUM_F77(
const int* n,
const std::complex<double> x[],
const int* incx);
217void PREFIX ZROTG_F77(std::complex<double>* da, std::complex<double>* db,
double* c, std::complex<double>* s);
218void 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);
219void 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);
220void PREFIX ZCOPY_F77(
const int* n,
const std::complex<double> *x,
const int* incx, std::complex<double> *y,
const int* incy);
221void PREFIX ZSCAL_F77(
const int* n,
const std::complex<double>* alpha, std::complex<double> *x,
const int* incx);
222void PREFIX ZSWAP_F77(
const int*
const n, std::complex<double>*
const x,
const int*
const incx,
223 std::complex<double>*
const y,
const int*
const incy);
224int PREFIX IZAMAX_F77(
const int* n,
const std::complex<double> *x,
const int* incx);
229#ifdef HAVE_TEUCHOS_BLASFLOAT
230# ifdef HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX
231# include <vecLib/cblas.h>
232# elif defined(HAVE_TEUCHOS_BLASFLOAT_DOUBLE_RETURN)
233double PREFIX SASUM_F77(
const int* n,
const float x[],
const int* incx);
234double PREFIX SDOT_F77(
const int* n,
const float x[],
const int* incx,
const float y[],
const int* incy);
235double PREFIX SNRM2_F77(
const int* n,
const float x[],
const int* incx);
238float PREFIX SDOT_F77(
const int* n,
const float x[],
const int* incx,
const float y[],
const int* incy);
243void PREFIX SROT_F77(
const int* n,
float* dx,
const int* incx,
float* dy,
const int* incy,
float* c,
float* s);
244void PREFIX SAXPY_F77(
const int* n,
const float* alpha,
const float x[],
const int* incx,
float y[],
const int* incy);
245void PREFIX SCOPY_F77(
const int* n,
const float *x,
const int* incx,
float *y,
const int* incy);
248 float*
const y,
const int*
const incy);
252#if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus)
253# if defined(HAVE_TEUCHOS_BLASFLOAT)
254# if defined(HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX)
256# include <vecLib/cblas.h>
257# elif defined(HAVE_TEUCHOS_BLASFLOAT_DOUBLE_RETURN)
258double PREFIX SCASUM_F77(
const int* n,
const std::complex<float> x[],
const int* incx);
259double PREFIX SCNRM2_F77(
const int* n,
const std::complex<float> x[],
const int* incx);
261float PREFIX SCASUM_F77(
const int* n,
const std::complex<float> x[],
const int* incx);
262float PREFIX SCNRM2_F77(
const int* n,
const std::complex<float> x[],
const int* incx);
266#if defined(HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX)
268#include <vecLib/cblas.h>
269#elif defined(HAVE_COMPLEX_BLAS_PROBLEM) && defined(HAVE_FIXABLE_COMPLEX_BLAS_PROBLEM)
270void 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);
271#elif defined(HAVE_TEUCHOS_BLASFLOAT)
277void PREFIX CROTG_F77(std::complex<float>* da, std::complex<float>* db,
float* c, std::complex<float>* s);
278void 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);
279void 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);
280void PREFIX CCOPY_F77(
const int* n,
const std::complex<float> *x,
const int* incx, std::complex<float> *y,
const int* incy);
281void PREFIX CSCAL_F77(
const int* n,
const std::complex<float>* alpha, std::complex<float> *x,
const int* incx);
282void PREFIX CSWAP_F77(
const int*
const n, std::complex<float>*
const x,
const int*
const incx,
283 std::complex<float>*
const y,
const int*
const incy);
284int PREFIX ICAMAX_F77(
const int* n,
const std::complex<float> *x,
const int* incx);
290 const double x[],
const int* incx,
const double* beta,
double y[],
const int* incy);
292 const double *a,
const int *lda,
double *x,
const int *incx);
293void PREFIX DGER_F77(
const int *m,
const int *n,
const double *alpha,
const double *x,
const int *incx,
const double *y,
294 const int *incy,
double *a,
const int *lda);
297#if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus)
299void PREFIX ZGEMV_F77(
Teuchos_fcd,
const int* m,
const int* n,
const std::complex<double>* alpha,
const std::complex<double>
A[],
const int* lda,
300 const std::complex<double> x[],
const int* incx,
const std::complex<double>* beta, std::complex<double> y[],
const int* incy);
302 const std::complex<double> *a,
const int *lda, std::complex<double> *x,
const int *incx);
303void 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,
304 const int *incy, std::complex<double> *a,
const int *lda);
310 const float x[],
const int* incx,
const float* beta,
float y[],
const int* incy);
312 const float *a,
const int *lda,
float *x,
const int *incx);
313void PREFIX SGER_F77(
const int *m,
const int *n,
const float *alpha,
const float *x,
const int *incx,
const float *y,
314 const int *incy,
float *a,
const int *lda);
317#if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus)
319void PREFIX CGEMV_F77(
Teuchos_fcd,
const int* m,
const int* n,
const std::complex<float>* alpha,
const std::complex<float>
A[],
const int* lda,
320 const std::complex<float> x[],
const int* incx,
const std::complex<float>* beta, std::complex<float> y[],
const int* incy);
322 const std::complex<float> *a,
const int *lda, std::complex<float> *x,
const int *incx);
323void 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,
324 const int *incy, std::complex<float> *a,
const int *lda);
330 n,
const int *k,
const double *alpha,
const double *a,
const int *lda,
331 const double *b,
const int *ldb,
const double *beta,
double *c,
const int *ldc);
333 const double *alpha,
const double *a,
const int *lda,
334 const double *b,
const int *ldb,
const double *beta,
double *c,
const int *ldc);
336 const double *alpha,
const double *a,
const int *lda,
337 const double *beta,
double *c,
const int *ldc);
339 const int *m,
const int *n,
const double *alpha,
const double *a,
const int * lda,
double *b,
const int *ldb);
341 const int *m,
const int *n,
const double *alpha,
const double *a,
const int *
342 lda,
double *b,
const int *ldb);
345#if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus)
348 n,
const int *k,
const std::complex<double> *alpha,
const std::complex<double> *a,
const int *lda,
349 const std::complex<double> *b,
const int *ldb,
const std::complex<double> *beta, std::complex<double> *c,
const int *ldc);
351 const std::complex<double> *alpha,
const std::complex<double> *a,
const int *lda,
352 const std::complex<double> *b,
const int *ldb,
const std::complex<double> *beta, std::complex<double> *c,
const int *ldc);
354 const std::complex<double> *alpha,
const std::complex<double> *a,
const int *lda,
355 const std::complex<double> *beta, std::complex<double> *c,
const int *ldc);
357 const std::complex<double> *alpha,
const std::complex<double> *a,
const int *lda,
358 const std::complex<double> *beta, std::complex<double> *c,
const int *ldc);
360 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);
362 const int *m,
const int *n,
const std::complex<double> *alpha,
const std::complex<double> *a,
const int *
363 lda, std::complex<double> *b,
const int *ldb);
369 n,
const int *k,
const float *alpha,
const float *a,
const int *lda,
370 const float *b,
const int *ldb,
const float *beta,
float *c,
const int *ldc);
372 const float *alpha,
const float *a,
const int *lda,
373 const float *b,
const int *ldb,
const float *beta,
float *c,
const int *ldc);
375 const float *alpha,
const float *a,
const int *lda,
376 const float *beta,
float *c,
const int *ldc);
378 const int *m,
const int *n,
const float *alpha,
const float *a,
const int * lda,
float *b,
const int *ldb);
380 const int *m,
const int *n,
const float *alpha,
const float *a,
const int *
381 lda,
float *b,
const int *ldb);
385#if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus)
388 n,
const int *k,
const std::complex<float> *alpha,
const std::complex<float> *a,
const int *lda,
389 const std::complex<float> *b,
const int *ldb,
const std::complex<float> *beta, std::complex<float> *c,
const int *ldc);
391 const std::complex<float> *alpha,
const std::complex<float> *a,
const int *lda,
392 const std::complex<float> *b,
const int *ldb,
const std::complex<float> *beta, std::complex<float> *c,
const int *ldc);
394 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);
396 const std::complex<float> *alpha,
const std::complex<float> *a,
const int *lda,
397 const std::complex<float> *beta, std::complex<float> *c,
const int *ldc);
399 const std::complex<float> *alpha,
const std::complex<float> *a,
const int *lda,
400 const std::complex<float> *beta, std::complex<float> *c,
const int *ldc);
402 const int *m,
const int *n,
const std::complex<float> *alpha,
const std::complex<float> *a,
const int *
403 lda, std::complex<float> *b,
const int *ldb);
#define Teuchos_Complex_double_type_name
#define Teuchos_Complex_float_type_name
Teuchos header file which uses auto-configuration information to include necessary C++ headers.