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 DSYMM_F77 F77_BLAS_MANGLE(dsymm,DSYMM) 89 #define DSYRK_F77 F77_BLAS_MANGLE(dsyrk,DSYRK) 90 #define DTRMM_F77 F77_BLAS_MANGLE(dtrmm,DTRMM) 91 #define DTRSM_F77 F77_BLAS_MANGLE(dtrsm,DTRSM) 93 #ifdef HAVE_TEUCHOS_COMPLEX 95 #define ZROTG_F77 F77_BLAS_MANGLE(zrotg,ZROTG) 96 #define ZROT_F77 F77_BLAS_MANGLE(zrot,ZROT) 97 #define ZASUM_F77 F77_BLAS_MANGLE(dzasum,DZASUM) 98 #define ZAXPY_F77 F77_BLAS_MANGLE(zaxpy,ZAXPY) 99 #define ZCOPY_F77 F77_BLAS_MANGLE(zcopy,ZCOPY) 100 #define ZDOT_F77 F77_BLAS_MANGLE(zdotc,ZDOTC) 101 #define ZNRM2_F77 F77_BLAS_MANGLE(dznrm2,DZNRM2) 102 #define ZSCAL_F77 F77_BLAS_MANGLE(zscal,ZSCAL) 103 #define IZAMAX_F77 F77_BLAS_MANGLE(izamax,IZAMAX) 104 #define ZGEMV_F77 F77_BLAS_MANGLE(zgemv,ZGEMV) 105 #define ZGER_F77 F77_BLAS_MANGLE(zgeru,ZGERU) 106 #define ZTRMV_F77 F77_BLAS_MANGLE(ztrmv,ZTRMV) 107 #define ZGEMM_F77 F77_BLAS_MANGLE(zgemm,ZGEMM) 108 #define ZSYMM_F77 F77_BLAS_MANGLE(zsymm,ZSYMM) 109 #define ZSYRK_F77 F77_BLAS_MANGLE(zsyrk,ZSYRK) 110 #define ZTRMM_F77 F77_BLAS_MANGLE(ztrmm,ZTRMM) 111 #define ZTRSM_F77 F77_BLAS_MANGLE(ztrsm,ZTRSM) 115 #define SROTG_F77 F77_BLAS_MANGLE(srotg,SROTG) 116 #define SROT_F77 F77_BLAS_MANGLE(srot,SROT) 117 #define SSCAL_F77 F77_BLAS_MANGLE(sscal,SSCAL) 118 #define SCOPY_F77 F77_BLAS_MANGLE(scopy,SCOPY) 119 #define SAXPY_F77 F77_BLAS_MANGLE(saxpy,SAXPY) 120 #define SDOT_F77 F77_BLAS_MANGLE(sdot,SDOT) 121 #define SNRM2_F77 F77_BLAS_MANGLE(snrm2,SNRM2) 122 #define SASUM_F77 F77_BLAS_MANGLE(sasum,SASUM) 123 #define ISAMAX_F77 F77_BLAS_MANGLE(isamax,ISAMAX) 124 #define SGEMV_F77 F77_BLAS_MANGLE(sgemv,SGEMV) 125 #define SGER_F77 F77_BLAS_MANGLE(sger,SGER) 126 #define STRMV_F77 F77_BLAS_MANGLE(strmv,STRMV) 127 #define SGEMM_F77 F77_BLAS_MANGLE(sgemm,SGEMM) 128 #define SSYMM_F77 F77_BLAS_MANGLE(ssymm,SSYMM) 129 #define SSYRK_F77 F77_BLAS_MANGLE(ssyrk,SSYRK) 130 #define STRMM_F77 F77_BLAS_MANGLE(strmm,STRMM) 131 #define STRSM_F77 F77_BLAS_MANGLE(strsm,STRSM) 133 #ifdef HAVE_TEUCHOS_COMPLEX 135 #define CROTG_F77 F77_BLAS_MANGLE(crotg,CROTG) 136 #define CROT_F77 F77_BLAS_MANGLE(crot,CROT) 137 #define SCASUM_F77 F77_BLAS_MANGLE(scasum,SCASUM) 138 #define CAXPY_F77 F77_BLAS_MANGLE(caxpy,CAXPY) 139 #define CCOPY_F77 F77_BLAS_MANGLE(ccopy,CCOPY) 140 #define CDOT_F77 F77_BLAS_MANGLE(cdotc,CDOTC) 141 #define SCNRM2_F77 F77_BLAS_MANGLE(scnrm2,SCNRM2) 142 #define CSCAL_F77 F77_BLAS_MANGLE(cscal,CSCAL) 143 #define ICAMAX_F77 F77_BLAS_MANGLE(icamax,ICAMAX) 144 #define CGEMV_F77 F77_BLAS_MANGLE(cgemv,CGEMV) 145 #define CGER_F77 F77_BLAS_MANGLE(cgeru,CGERU) 146 #define CTRMV_F77 F77_BLAS_MANGLE(ctrmv,CTRMV) 147 #define CGEMM_F77 F77_BLAS_MANGLE(cgemm,CGEMM) 148 #define CSYMM_F77 F77_BLAS_MANGLE(csymm,CSYMM) 149 #define CSYRK_F77 F77_BLAS_MANGLE(csyrk,CSYRK) 150 #define CTRMM_F77 F77_BLAS_MANGLE(ctrmm,CTRMM) 151 #define CTRSM_F77 F77_BLAS_MANGLE(ctrsm,CTRSM) 165 void PREFIX DROT_F77(
const int*
n,
double* dx,
const int* incx,
double* dy,
const int* incy,
double* c,
double* s);
166 double PREFIX DASUM_F77(
const int* n,
const double x[],
const int* incx);
167 void PREFIX DAXPY_F77(
const int* n,
const double* alpha,
const double x[],
const int* incx,
double y[],
const int* incy);
168 void PREFIX DCOPY_F77(
const int* n,
const double *x,
const int* incx,
double *y,
const int* incy);
169 double PREFIX DDOT_F77(
const int* n,
const double x[],
const int* incx,
const double y[],
const int* incy);
170 double PREFIX DNRM2_F77(
const int* n,
const double x[],
const int* incx);
171 void PREFIX DSCAL_F77(
const int* n,
const double* alpha,
double *x,
const int* incx);
175 #if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus) 177 # if defined(HAVE_COMPLEX_BLAS_PROBLEM) 178 # if defined(HAVE_FIXABLE_COMPLEX_BLAS_PROBLEM) 179 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);
180 # elif defined(HAVE_VECLIB_COMPLEX_BLAS) 182 # include <vecLib/cblas.h> 188 # endif // HAVE_COMPLEX_BLAS_PROBLEM 190 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);
191 # endif // defined(HAVE_COMPLEX_BLAS_PROBLEM) 193 double PREFIX ZNRM2_F77(
const int* n,
const std::complex<double> x[],
const int* incx);
194 double PREFIX ZASUM_F77(
const int* n,
const std::complex<double> x[],
const int* incx);
195 void PREFIX ZROTG_F77(std::complex<double>* da, std::complex<double>* db,
double* c, std::complex<double>* s);
196 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);
197 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);
198 void PREFIX ZCOPY_F77(
const int* n,
const std::complex<double> *x,
const int* incx, std::complex<double> *y,
const int* incy);
199 void PREFIX ZSCAL_F77(
const int* n,
const std::complex<double>* alpha, std::complex<double> *x,
const int* incx);
200 int PREFIX IZAMAX_F77(
const int* n,
const std::complex<double> *x,
const int* incx);
205 #ifdef HAVE_TEUCHOS_BLASFLOAT 206 # ifdef HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX 207 # include <vecLib/cblas.h> 208 # elif defined(HAVE_TEUCHOS_BLASFLOAT_DOUBLE_RETURN) 209 double PREFIX SASUM_F77(
const int* n,
const float x[],
const int* incx);
210 double PREFIX SDOT_F77(
const int* n,
const float x[],
const int* incx,
const float y[],
const int* incy);
211 double PREFIX SNRM2_F77(
const int* n,
const float x[],
const int* incx);
213 float PREFIX SASUM_F77(
const int* n,
const float x[],
const int* incx);
214 float PREFIX SDOT_F77(
const int* n,
const float x[],
const int* incx,
const float y[],
const int* incy);
215 float PREFIX SNRM2_F77(
const int* n,
const float x[],
const int* incx);
216 # endif // which blasfloat 217 #endif // ifdef blasfloat 219 void PREFIX SROT_F77(
const int* n,
float* dx,
const int* incx,
float* dy,
const int* incy,
float* c,
float* s);
220 void PREFIX SAXPY_F77(
const int* n,
const float* alpha,
const float x[],
const int* incx,
float y[],
const int* incy);
221 void PREFIX SCOPY_F77(
const int* n,
const float *x,
const int* incx,
float *y,
const int* incy);
222 void PREFIX SSCAL_F77(
const int* n,
const float* alpha,
float *x,
const int* incx);
226 #if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus) 227 # if defined(HAVE_TEUCHOS_BLASFLOAT) 228 # if defined(HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX) 230 # include <vecLib/cblas.h> 231 # elif defined(HAVE_TEUCHOS_BLASFLOAT_DOUBLE_RETURN) 232 double PREFIX SCASUM_F77(
const int* n,
const std::complex<float> x[],
const int* incx);
233 double PREFIX SCNRM2_F77(
const int* n,
const std::complex<float> x[],
const int* incx);
235 float PREFIX SCASUM_F77(
const int* n,
const std::complex<float> x[],
const int* incx);
236 float PREFIX SCNRM2_F77(
const int* n,
const std::complex<float> x[],
const int* incx);
237 # endif // Whether or not we have the veclib bugfix 238 #endif // defined(HAVE_TEUCHOS_BLASFLOAT) 240 #if defined(HAVE_TEUCHOS_BLASFLOAT_APPLE_VECLIB_BUGFIX) 242 #include <vecLib/cblas.h> 243 #elif defined(HAVE_COMPLEX_BLAS_PROBLEM) && defined(HAVE_FIXABLE_COMPLEX_BLAS_PROBLEM) 244 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);
245 #elif defined(HAVE_TEUCHOS_BLASFLOAT) 246 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);
251 void PREFIX CROTG_F77(std::complex<float>* da, std::complex<float>* db,
float* c, std::complex<float>* s);
252 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);
253 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);
254 void PREFIX CCOPY_F77(
const int* n,
const std::complex<float> *x,
const int* incx, std::complex<float> *y,
const int* incy);
255 void PREFIX CSCAL_F77(
const int* n,
const std::complex<float>* alpha, std::complex<float> *x,
const int* incx);
256 int PREFIX ICAMAX_F77(
const int* n,
const std::complex<float> *x,
const int* incx);
262 const double x[],
const int* incx,
const double* beta,
double y[],
const int* incy);
264 const double *a,
const int *lda,
double *x,
const int *incx);
265 void PREFIX DGER_F77(
const int *m,
const int *n,
const double *alpha,
const double *x,
const int *incx,
const double *y,
266 const int *incy,
double *a,
const int *lda);
269 #if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus) 271 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,
272 const std::complex<double> x[],
const int* incx,
const std::complex<double>* beta, std::complex<double> y[],
const int* incy);
274 const std::complex<double> *a,
const int *lda, std::complex<double> *x,
const int *incx);
275 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,
276 const int *incy, std::complex<double> *a,
const int *lda);
282 const float x[],
const int* incx,
const float* beta,
float y[],
const int* incy);
284 const float *a,
const int *lda,
float *x,
const int *incx);
285 void PREFIX SGER_F77(
const int *m,
const int *n,
const float *alpha,
const float *x,
const int *incx,
const float *y,
286 const int *incy,
float *a,
const int *lda);
289 #if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus) 291 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,
292 const std::complex<float> x[],
const int* incx,
const std::complex<float>* beta, std::complex<float> y[],
const int* incy);
294 const std::complex<float> *a,
const int *lda, std::complex<float> *x,
const int *incx);
295 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,
296 const int *incy, std::complex<float> *a,
const int *lda);
302 n,
const int *k,
const double *alpha,
const double *a,
const int *lda,
303 const double *b,
const int *ldb,
const double *beta,
double *c,
const int *ldc);
305 const double *alpha,
const double *a,
const int *lda,
306 const double *b,
const int *ldb,
const double *beta,
double *c,
const int *ldc);
308 const double *alpha,
const double *a,
const int *lda,
309 const double *beta,
double *c,
const int *ldc);
311 const int *m,
const int *n,
const double *alpha,
const double *a,
const int * lda,
double *b,
const int *ldb);
313 const int *m,
const int *n,
const double *alpha,
const double *a,
const int *
314 lda,
double *b,
const int *ldb);
317 #if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus) 320 n,
const int *k,
const std::complex<double> *alpha,
const std::complex<double> *a,
const int *lda,
321 const std::complex<double> *b,
const int *ldb,
const std::complex<double> *beta, std::complex<double> *c,
const int *ldc);
323 const std::complex<double> *alpha,
const std::complex<double> *a,
const int *lda,
324 const std::complex<double> *b,
const int *ldb,
const std::complex<double> *beta, std::complex<double> *c,
const int *ldc);
326 const std::complex<double> *alpha,
const std::complex<double> *a,
const int *lda,
327 const std::complex<double> *beta, std::complex<double> *c,
const int *ldc);
329 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);
331 const int *m,
const int *n,
const std::complex<double> *alpha,
const std::complex<double> *a,
const int *
332 lda, std::complex<double> *b,
const int *ldb);
338 n,
const int *k,
const float *alpha,
const float *a,
const int *lda,
339 const float *b,
const int *ldb,
const float *beta,
float *c,
const int *ldc);
341 const float *alpha,
const float *a,
const int *lda,
342 const float *b,
const int *ldb,
const float *beta,
float *c,
const int *ldc);
344 const float *alpha,
const float *a,
const int *lda,
345 const float *beta,
float *c,
const int *ldc);
347 const int *m,
const int *n,
const float *alpha,
const float *a,
const int * lda,
float *b,
const int *ldb);
349 const int *m,
const int *n,
const float *alpha,
const float *a,
const int *
350 lda,
float *b,
const int *ldb);
354 #if defined(HAVE_TEUCHOS_COMPLEX) && defined(__cplusplus) 357 n,
const int *k,
const std::complex<float> *alpha,
const std::complex<float> *a,
const int *lda,
358 const std::complex<float> *b,
const int *ldb,
const std::complex<float> *beta, std::complex<float> *c,
const int *ldc);
360 const std::complex<float> *alpha,
const std::complex<float> *a,
const int *lda,
361 const std::complex<float> *b,
const int *ldb,
const std::complex<float> *beta, std::complex<float> *c,
const int *ldc);
363 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);
365 const std::complex<float> *alpha,
const std::complex<float> *a,
const int *lda,
366 const std::complex<float> *beta, std::complex<float> *c,
const int *ldc);
368 const int *m,
const int *n,
const std::complex<float> *alpha,
const std::complex<float> *a,
const int *
369 lda, std::complex<float> *b,
const int *ldb);
Teuchos header file which uses auto-configuration information to include necessary C++ headers...