xref: /petsc/include/petscblaslapack.h (revision 586f9135a435d5a6381b69bc5827c0012b4bcf1e)
1a1e12872SBarry Smith /*
24fcfbe5fSBarry Smith   This file dispatches between various header files for blas/lapack distributions to handle the name mangling.
34fcfbe5fSBarry Smith   It also provides C prototypes for all the BLAS/LAPACK functions that PETSc uses
4f3da1532SBarry Smith 
5f3da1532SBarry Smith   This is not included automatically by petscsys.h because some external packages include their own prototypes for
6f3da1532SBarry Smith   certain BLAS/LAPACK functions that conflict with the ones given here. Hence this should only be included when needed.
7f3da1532SBarry Smith 
837c12098SBarry Smith   The BLAS/LAPACK name mangling is almost (but not always) the same as the Fortran mangling; and exists even if there is
937c12098SBarry Smith   not Fortran compiler.
1037c12098SBarry Smith 
1137c12098SBarry Smith   PETSC_BLASLAPACK_UNDERSCORE BLAS/LAPACK function have an underscore at the end of each function name
1237c12098SBarry Smith   PETSC_BLASLAPACK_CAPS BLAS/LAPACK function names are all in capital letters
1337c12098SBarry Smith   PETSC_BLASLAPACK_C BLAS/LAPACK function names have no mangling
1437c12098SBarry Smith 
1537c12098SBarry Smith   PETSC_BLASLAPACK_SINGLEISDOUBLE - for Cray systems where the BLAS/LAPACK single precision (i.e. Fortran single precision is actually 64 bits)
1637c12098SBarry Smith                                     old Cray vector machines used to be this way, it is is not clear if any exist now.
1737c12098SBarry Smith 
18570b7f6dSBarry Smith   PetscBLASInt is almost always 32 bit integers but can be 64 bit integers for certain usages of MKL and OpenBLAS BLAS/LAPACK libraries
1937c12098SBarry Smith 
20a1e12872SBarry Smith */
21c3e41550SBarry Smith #if !defined(_BLASLAPACK_H)
22c3e41550SBarry Smith #define _BLASLAPACK_H
23bb638ab5SSatish Balay 
246c737031SSatish Balay #include <petscconf.h>
256c737031SSatish Balay #if defined(__cplusplus)
266c737031SSatish Balay #define BLAS_EXTERN extern "C"
276c737031SSatish Balay #else
286c737031SSatish Balay #define BLAS_EXTERN extern
296c737031SSatish Balay #endif
306c737031SSatish Balay 
31*586f9135SBarry Smith /*MC
32*586f9135SBarry Smith     PetscStackCallBLAS - Calls a BLAS or LAPACK routine with error check handling
33*586f9135SBarry Smith 
34*586f9135SBarry Smith     Not collective
35*586f9135SBarry Smith 
36*586f9135SBarry Smith     Synopsis:
37*586f9135SBarry Smith    #include <petscsys.h>
38*586f9135SBarry Smith    void PetscStackCallBLAS(char *name,routine)
39*586f9135SBarry Smith 
40*586f9135SBarry Smith   Input Parameters:
41*586f9135SBarry Smith +   name - string that gives the name of the function being called
42*586f9135SBarry Smith -   routine - actual call to the routine including its arguments
43*586f9135SBarry Smith 
44*586f9135SBarry Smith    Level: developer
45*586f9135SBarry Smith 
46*586f9135SBarry Smith    Developer Note:
47*586f9135SBarry Smith    This is so that when a user or external library routine results in a crash or corrupts memory, they get blamed instead of PETSc.
48*586f9135SBarry Smith 
49*586f9135SBarry Smith .seealso: `PetscCall()`, `PetscStackPushNoCheck()`, `PetscStackPush()`, `PetscStackCallStandard()`, `PetscStackCall()`
50*586f9135SBarry Smith M*/
518b83055fSJed Brown #define PetscStackCallBLAS(name,routine) do {                   \
52a2f94806SJed Brown     PetscStackPushNoCheck(name,PETSC_FALSE,PETSC_TRUE);         \
538b83055fSJed Brown     routine;                                                    \
548b83055fSJed Brown     PetscStackPop;                                              \
558b83055fSJed Brown   } while (0)
568b83055fSJed Brown 
573ca90d2dSJacob Faibussowitsch static inline void PetscMissingLapack(const char *fname,...)
583c377650SSatish Balay {
593ca90d2dSJacob Faibussowitsch   PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,PETSC_ERR_SUP,PETSC_ERROR_INITIAL,"%s - Lapack routine is unavailable.",fname);
603ca90d2dSJacob Faibussowitsch   MPI_Abort(PETSC_COMM_SELF,PETSC_ERR_SUP);
613c377650SSatish Balay }
623c377650SSatish Balay 
63e5b2100bSSteven G. Johnson #include <petscblaslapack_mangle.h>
64a1e12872SBarry Smith 
656c737031SSatish Balay BLAS_EXTERN void LAPACKgetrf_(PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
66b9d4cb8dSJed Brown BLAS_EXTERN void LAPACKREALgetrf_(PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
676c737031SSatish Balay BLAS_EXTERN void LAPACKgetri_(PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
68b9d4cb8dSJed Brown BLAS_EXTERN void LAPACKREALgetri_(PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*);
693c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_ORGQR)
70c964aadfSJose E. Roman BLAS_EXTERN void LAPACKorgqr_(PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
713c377650SSatish Balay #else
723c377650SSatish Balay #define LAPACKorgqr_(a,b,c,d,e,f,g,h,i) PetscMissingLapack("ORGQR",a,b,c,d,e,f,g,h,i)
733c377650SSatish Balay #endif
746c737031SSatish Balay BLAS_EXTERN void LAPACKgeqrf_(PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
7549b12944SBarry Smith #if defined(PETSC_USE_REAL_SINGLE) && defined(PETSC_BLASLAPACK_SNRM2_RETURNS_DOUBLE)
766c737031SSatish Balay BLAS_EXTERN double BLASnrm2_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*);
7749b12944SBarry Smith #else
786c737031SSatish Balay BLAS_EXTERN PetscReal BLASnrm2_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*);
7949b12944SBarry Smith #endif
806c737031SSatish Balay BLAS_EXTERN void BLASscal_(const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*);
816c737031SSatish Balay BLAS_EXTERN void BLAScopy_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*);
826c737031SSatish Balay BLAS_EXTERN void BLASswap_(const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*);
836c737031SSatish Balay BLAS_EXTERN void BLASaxpy_(const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*);
8451da93a6SBarry Smith #if defined(PETSC_USE_REAL_SINGLE) && defined(PETSC_BLASLAPACK_SNRM2_RETURNS_DOUBLE)
856c737031SSatish Balay BLAS_EXTERN double BLASasum_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*);
8651da93a6SBarry Smith #else
876c737031SSatish Balay BLAS_EXTERN PetscReal BLASasum_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*);
8851da93a6SBarry Smith #endif
896c737031SSatish Balay BLAS_EXTERN void LAPACKpttrf_(const PetscBLASInt*,PetscReal*,PetscScalar*,const PetscBLASInt*);
903c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_STEIN)
916c737031SSatish Balay BLAS_EXTERN void LAPACKstein_(const PetscBLASInt*,PetscReal*,PetscReal*,const PetscBLASInt*,PetscReal*,const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscReal*,const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*);
923c377650SSatish Balay #else
933c377650SSatish Balay #define LAPACKstein_(a,b,c,d,e,f,g,h,i,j,k,l,m) PetscMissingLapack("STEIN",a,b,c,d,e,f,g,h,i,j,k,l)
943c377650SSatish Balay #endif
956c737031SSatish Balay BLAS_EXTERN void LAPACKgesv_(const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*);
96c35b00c6SBarry Smith 
976c737031SSatish Balay BLAS_EXTERN void LAPACKpotrf_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
986c737031SSatish Balay BLAS_EXTERN void LAPACKpotri_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
996c737031SSatish Balay BLAS_EXTERN void LAPACKpotrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
1006c737031SSatish Balay BLAS_EXTERN void LAPACKsytrf_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
1016c737031SSatish Balay BLAS_EXTERN void LAPACKsytrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
1023c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_SYTRI)
1036c737031SSatish Balay BLAS_EXTERN void LAPACKsytri_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*);
1043c377650SSatish Balay #else
1053c377650SSatish Balay #define LAPACKsytri_(a,b,c,d,e,f,g) PetscMissingLapack("SYTRI",a,b,c,d,e,f,g)
1063c377650SSatish Balay #endif
107916c178eSAndreas Fink BLAS_EXTERN void BLASsyrk_(const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*);
108916c178eSAndreas Fink BLAS_EXTERN void BLASsyr2k_(const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*);
1096c737031SSatish Balay BLAS_EXTERN void BLASgemv_(const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,const PetscScalar *,const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*);
1106c737031SSatish Balay BLAS_EXTERN void LAPACKgetrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
111916c178eSAndreas Fink BLAS_EXTERN void BLAStrmv_(const char*,const char*,const char*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*);
112916c178eSAndreas Fink BLAS_EXTERN void BLASgemm_(const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*);
113b9d4cb8dSJed Brown BLAS_EXTERN void BLASREALgemm_(const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*,const PetscReal*,const PetscReal*,const PetscBLASInt*,const PetscReal*,const PetscBLASInt*,const PetscReal*,PetscReal*,const PetscBLASInt*);
114916c178eSAndreas Fink BLAS_EXTERN void BLASsymm_(const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*);
1156c737031SSatish Balay BLAS_EXTERN void BLAStrsm_(const char*,const char*,const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*);
1163c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_ORMQR)
117872393edSJose E. Roman BLAS_EXTERN void LAPACKormqr_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
1183c377650SSatish Balay #else
1193c377650SSatish Balay #define LAPACKormqr_(a,b,c,d,e,f,g,h,i,j,k,l,m) PetscMissingLapack("ORMQR",a,b,c,d,e,f,g,h,i,j,k,l,m)
1203c377650SSatish Balay #endif
1219369748bSToby Isaac #if !defined(PETSC_MISSING_LAPACK_STEGR)
1229369748bSToby Isaac BLAS_EXTERN void LAPACKstegr_(const char*,const char *,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
1239369748bSToby Isaac #else
1249369748bSToby Isaac #define LAPACKstegr_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) PetscMissingLapack("STEGR",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t)
1259369748bSToby Isaac #endif
1263c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_STEQR)
1276c737031SSatish Balay BLAS_EXTERN void LAPACKsteqr_(const char*,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*);
1286c737031SSatish Balay BLAS_EXTERN void LAPACKREALsteqr_(const char*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscReal*,PetscBLASInt*);
1293c377650SSatish Balay #else
1303c377650SSatish Balay #define LAPACKsteqr_(a,b,c,d,e,f,g,h) PetscMissingLapack("STEQR",a,b,c,d,e,f,g,h)
1313c377650SSatish Balay #define LAPACKREALsteqr_(a,b,c,d,e,f,g,h) PetscMissingLapack("STEQR",a,b,c,d,e,f,g,h)
1323c377650SSatish Balay #endif
1333c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_HGEQZ)
1346c737031SSatish Balay BLAS_EXTERN void LAPACKhgeqz_(const char *,const char *,const char *,PetscBLASInt *,PetscBLASInt *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscScalar *,PetscScalar *,PetscScalar *,PetscScalar *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscBLASInt *);
1353c377650SSatish Balay #else
1363c377650SSatish Balay #define LAPACKhgeqz_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) PetscMissingLapack("HGEQZ",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t)
1373c377650SSatish Balay #endif
1383c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TRTRS)
1396c737031SSatish Balay BLAS_EXTERN void LAPACKtrtrs_(const char *,const char *, const char *,PetscBLASInt *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscBLASInt *);
1403c377650SSatish Balay #else
1413c377650SSatish Balay #define LAPACKtrtrs_(a,b,c,d,e,f,g,h,i,j) PetscMissingLapack("TRTRS",a,b,c,d,e,f,g,h,i,j)
1423c377650SSatish Balay #endif
1436c737031SSatish Balay BLAS_EXTERN void LAPACKgels_(const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*);
144c35b00c6SBarry Smith 
145f16551e9SSatish Balay /* handle complex dot() with special code */
146f16551e9SSatish Balay #if defined(PETSC_USE_COMPLEX)
1479fbee547SJacob Faibussowitsch static inline PetscScalar BLASdot_(const PetscBLASInt *n,const PetscScalar *x,const PetscBLASInt *sx,const PetscScalar *y,const PetscBLASInt *sy)
148f16551e9SSatish Balay {
149f16551e9SSatish Balay   PetscScalar sum=0.0;
1509669e4d8SBarry Smith   PetscInt    i,j,k;
151f16551e9SSatish Balay   if (*sx==1 && *sy==1) {
152f16551e9SSatish Balay     for (i=0; i < *n; i++) sum += PetscConj(x[i])*y[i];
153f16551e9SSatish Balay   } else {
154f16551e9SSatish Balay     for (i=0,j=0,k=0; i < *n; i++,j+=*sx,k+=*sy) sum += PetscConj(x[j])*y[k];
155f16551e9SSatish Balay   }
156f16551e9SSatish Balay   return sum;
157f16551e9SSatish Balay }
1589fbee547SJacob Faibussowitsch static inline PetscScalar BLASdotu_(const PetscBLASInt *n,const PetscScalar *x,const PetscBLASInt *sx,const PetscScalar *y,const PetscBLASInt *sy)
159f16551e9SSatish Balay {
160f16551e9SSatish Balay   PetscScalar sum=0.0;
1619669e4d8SBarry Smith   PetscInt    i,j,k;
162f16551e9SSatish Balay   if (*sx==1 && *sy==1) {
163f16551e9SSatish Balay     for (i=0; i < *n; i++) sum += x[i]*y[i];
164f16551e9SSatish Balay   } else {
165f16551e9SSatish Balay     for (i=0,j=0,k=0; i < *n; i++,j+=*sx,k+=*sy) sum += x[j]*y[k];
166f16551e9SSatish Balay   }
167f16551e9SSatish Balay   return sum;
168f16551e9SSatish Balay }
169f16551e9SSatish Balay #else
17049b12944SBarry Smith #if defined(PETSC_USE_REAL_SINGLE) && defined(PETSC_BLASLAPACK_SDOT_RETURNS_DOUBLE)
1716c737031SSatish Balay BLAS_EXTERN double BLASdot_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*);
1726c737031SSatish Balay BLAS_EXTERN double BLASdotu_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*);
17349b12944SBarry Smith #else
1746c737031SSatish Balay BLAS_EXTERN PetscScalar BLASdot_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*);
175f16551e9SSatish Balay #endif
17649b12944SBarry Smith #endif
177f16551e9SSatish Balay 
17865da4498SStefano Zampini /* Some functions prototypes do not exist for reals */
17965da4498SStefano Zampini #if defined(PETSC_USE_COMPLEX)
1806c737031SSatish Balay BLAS_EXTERN void LAPACKhetrf_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
1816c737031SSatish Balay BLAS_EXTERN void LAPACKhetrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
1826c737031SSatish Balay BLAS_EXTERN void LAPACKhetri_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*);
1831153b427SDavid Wells BLAS_EXTERN void LAPACKheev_(const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*);
18465da4498SStefano Zampini #endif
185976cf19bSSatish Balay /* Some functions prototypes differ between real and complex */
186976cf19bSSatish Balay #if defined(PETSC_USE_COMPLEX)
1873c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GELSS)
1886c737031SSatish Balay BLAS_EXTERN void LAPACKgelss_(const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscReal*,const PetscReal*,PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscReal*,PetscBLASInt*);
1893c377650SSatish Balay #else
1903c377650SSatish Balay #define LAPACKgelss_(a,b,c,d,e,f,g,h,i,j,k,l,m,n) PetscMissingLapack("GELSS",a,b,c,d,e,f,g,h,i,j,k,l,m,n)
1913c377650SSatish Balay #endif
1926c737031SSatish Balay BLAS_EXTERN void LAPACKsyev_(const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*);
1936c737031SSatish Balay BLAS_EXTERN void LAPACKsyevx_(const char*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
1946c737031SSatish Balay BLAS_EXTERN void LAPACKsygv_(PetscBLASInt*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*);
1956c737031SSatish Balay BLAS_EXTERN void LAPACKsygvx_(PetscBLASInt*,const char*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
1966c737031SSatish Balay BLAS_EXTERN void LAPACKpttrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
1973c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GERFS)
1986c737031SSatish Balay BLAS_EXTERN void LAPACKgerfs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscReal*,PetscBLASInt*);
1993c377650SSatish Balay #else
2003c377650SSatish Balay #define LAPACKgerfs_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) PetscMissingLapack("GERFS",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q)
2013c377650SSatish Balay #endif
2023c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TRSEN)
2036c737031SSatish Balay BLAS_EXTERN void LAPACKtrsen_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
2043c377650SSatish Balay #else
2053c377650SSatish Balay #define LAPACKtrsen_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) PetscMissingLapack("TRSEN",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o)
2063c377650SSatish Balay #endif
2073c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TGSEN)
2086c737031SSatish Balay BLAS_EXTERN void LAPACKtgsen_(PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
2093c377650SSatish Balay #else
2103c377650SSatish Balay #define LAPACKtgsen_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x) PetscMissingLapack("TGSEN",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x)
2113c377650SSatish Balay #endif
2123c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GGES)
2136c737031SSatish Balay BLAS_EXTERN void LAPACKgges_(const char*,const char*,const char*,PetscBLASInt(*)(),PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*);
2143c377650SSatish Balay #else
2153c377650SSatish Balay #define LAPACKgges_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) PetscMissingLapack("GGES",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u)
2163c377650SSatish Balay #endif
2173c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_HSEQR)
2186c737031SSatish Balay BLAS_EXTERN void LAPACKhseqr_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
219976cf19bSSatish Balay #else
2203c377650SSatish Balay #define LAPACKhseqr_(a,b,c,d,e,f,g,h,i,j,k,l,m) PetscMissingLapack("HSEQR",a,b,c,d,e,f,g,h,i,j,k,l,m)
2213c377650SSatish Balay #endif
2223c377650SSatish Balay #else /* !defined(PETSC_USE_COMPLEX) */
2233c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GELSS)
2246c737031SSatish Balay BLAS_EXTERN void LAPACKgelss_(const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscReal*,const PetscReal*,PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*);
2253c377650SSatish Balay #else
2263c377650SSatish Balay #define LAPACKgelss_(a,b,c,d,e,f,g,h,i,j,k,l,m) PetscMissingLapack("GELSS",a,b,c,d,e,f,g,h,i,j,k,l,m)
2273c377650SSatish Balay #endif
2286c737031SSatish Balay BLAS_EXTERN void LAPACKsyev_(const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
2296c737031SSatish Balay BLAS_EXTERN void LAPACKsyevx_(const char*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
2306c737031SSatish Balay BLAS_EXTERN void LAPACKsygv_(PetscBLASInt*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
2316c737031SSatish Balay BLAS_EXTERN void LAPACKsygvx_(PetscBLASInt*,const char*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
2326c737031SSatish Balay BLAS_EXTERN void LAPACKpttrs_(PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
2333c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_STEBZ)
2346c737031SSatish Balay BLAS_EXTERN void LAPACKstebz_(const char*,const char*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*);
2353c377650SSatish Balay #else
2363c377650SSatish Balay #define LAPACKstebz_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) PetscMissingLapack("STEBZ",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r)
237976cf19bSSatish Balay #endif
2383c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GERFS)
2393c377650SSatish Balay BLAS_EXTERN void LAPACKgerfs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
2403c377650SSatish Balay #else
2413c377650SSatish Balay #define LAPACKgerfs_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) PetscMissingLapack("GERFS",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q)
2423c377650SSatish Balay #endif
2433c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TRSEN)
2443c377650SSatish Balay BLAS_EXTERN void LAPACKtrsen_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscReal*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
2453c377650SSatish Balay #else
2463c377650SSatish Balay #define LAPACKtrsen_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) PetscMissingLapack("TRSEN",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r)
2473c377650SSatish Balay #endif
2483c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TGSEN)
2493c377650SSatish Balay BLAS_EXTERN void LAPACKtgsen_(PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
2503c377650SSatish Balay #else
2513c377650SSatish Balay #define LAPACKtgsen_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y) PetscMissingLapack("TGSEN",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y)
2523c377650SSatish Balay #endif
2533c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GGES)
2543c377650SSatish Balay BLAS_EXTERN void LAPACKgges_(const char*,const char*,const char*,PetscBLASInt(*)(void),PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*);
2553c377650SSatish Balay #else
2563c377650SSatish Balay #define LAPACKgges_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) PetscMissingLapack("GGES",a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u)
2573c377650SSatish Balay #endif
2583c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_HSEQR)
2593c377650SSatish Balay BLAS_EXTERN void LAPACKhseqr_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
2603c377650SSatish Balay #else
2613c377650SSatish Balay #define LAPACKhseqr_(a,b,c,d,e,f,g,h,i,j,k,l,m,n) PetscMissingLapack("HSEQR",a,b,c,d,e,f,g,h,i,j,k,l,m,n)
2623c377650SSatish Balay #endif
2633c377650SSatish Balay #endif /* defined(PETSC_USE_COMPLEX) */
264976cf19bSSatish Balay 
2651148afceSStefano Zampini #if defined(PETSC_USE_COMPLEX)
2666c737031SSatish Balay BLAS_EXTERN void LAPACKgeev_(const char*,const char*,PetscBLASInt *,PetscScalar *,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*);
267e2b200f6SPierre Jolivet BLAS_EXTERN void LAPACKgesvd_(const char*,const char*,const PetscBLASInt *,const PetscBLASInt*,PetscScalar *,const PetscBLASInt*,PetscReal*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscReal*,PetscBLASInt*);
268976cf19bSSatish Balay #else
2696c737031SSatish Balay BLAS_EXTERN void LAPACKgeev_(const char*,const char*,PetscBLASInt *,PetscScalar *,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*);
270e2b200f6SPierre Jolivet BLAS_EXTERN void LAPACKgesvd_(const char*,const char*,const PetscBLASInt *,const PetscBLASInt*,PetscScalar *,const PetscBLASInt*,PetscReal*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*);
271c35b00c6SBarry Smith #endif
272c35b00c6SBarry Smith 
273c35b00c6SBarry Smith #endif
274