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 31ef1023bdSBarry Smith /* SUBMANSEC = Sys */ 32ef1023bdSBarry Smith 33586f9135SBarry Smith /*MC 34792fecdfSBarry Smith PetscCallBLAS - Calls a BLAS or LAPACK routine with error check handling 35586f9135SBarry Smith 36586f9135SBarry Smith Not collective 37586f9135SBarry Smith 38586f9135SBarry Smith Synopsis: 39586f9135SBarry Smith #include <petscsys.h> 40792fecdfSBarry Smith void PetscCallBLAS(char *name,routine) 41586f9135SBarry Smith 42586f9135SBarry Smith Input Parameters: 43586f9135SBarry Smith + name - string that gives the name of the function being called 44586f9135SBarry Smith - routine - actual call to the routine including its arguments 45586f9135SBarry Smith 46586f9135SBarry Smith Level: developer 47586f9135SBarry Smith 48586f9135SBarry Smith Developer Note: 49586f9135SBarry 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. 50586f9135SBarry Smith 51*e77caa6dSBarry Smith .seealso: `PetscCall()`, `PetscStackPushNoCheck()`, `PetscStackPush()`, `PetscCallExternal()`, `PetscStackCallExternalVoid()` 52586f9135SBarry Smith M*/ 53792fecdfSBarry Smith #define PetscCallBLAS(name,routine) do { \ 54792fecdfSBarry Smith PetscStackPushExternal(name); \ 558b83055fSJed Brown routine; \ 568b83055fSJed Brown PetscStackPop; \ 578b83055fSJed Brown } while (0) 588b83055fSJed Brown 593ca90d2dSJacob Faibussowitsch static inline void PetscMissingLapack(const char *fname,...) 603c377650SSatish Balay { 613ca90d2dSJacob Faibussowitsch PetscError(PETSC_COMM_SELF,__LINE__,PETSC_FUNCTION_NAME,__FILE__,PETSC_ERR_SUP,PETSC_ERROR_INITIAL,"%s - Lapack routine is unavailable.",fname); 623ca90d2dSJacob Faibussowitsch MPI_Abort(PETSC_COMM_SELF,PETSC_ERR_SUP); 633c377650SSatish Balay } 643c377650SSatish Balay 65e5b2100bSSteven G. Johnson #include <petscblaslapack_mangle.h> 66a1e12872SBarry Smith 676c737031SSatish Balay BLAS_EXTERN void LAPACKgetrf_(PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 68b9d4cb8dSJed Brown BLAS_EXTERN void LAPACKREALgetrf_(PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 696c737031SSatish Balay BLAS_EXTERN void LAPACKgetri_(PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 70b9d4cb8dSJed Brown BLAS_EXTERN void LAPACKREALgetri_(PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*); 713c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_ORGQR) 72c964aadfSJose E. Roman BLAS_EXTERN void LAPACKorgqr_(PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 733c377650SSatish Balay #else 743c377650SSatish Balay #define LAPACKorgqr_(a,b,c,d,e,f,g,h,i) PetscMissingLapack("ORGQR",a,b,c,d,e,f,g,h,i) 753c377650SSatish Balay #endif 766c737031SSatish Balay BLAS_EXTERN void LAPACKgeqrf_(PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 7749b12944SBarry Smith #if defined(PETSC_USE_REAL_SINGLE) && defined(PETSC_BLASLAPACK_SNRM2_RETURNS_DOUBLE) 786c737031SSatish Balay BLAS_EXTERN double BLASnrm2_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 7949b12944SBarry Smith #else 806c737031SSatish Balay BLAS_EXTERN PetscReal BLASnrm2_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 8149b12944SBarry Smith #endif 826c737031SSatish Balay BLAS_EXTERN void BLASscal_(const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*); 836c737031SSatish Balay BLAS_EXTERN void BLAScopy_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*); 846c737031SSatish Balay BLAS_EXTERN void BLASswap_(const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*); 856c737031SSatish Balay BLAS_EXTERN void BLASaxpy_(const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*); 8651da93a6SBarry Smith #if defined(PETSC_USE_REAL_SINGLE) && defined(PETSC_BLASLAPACK_SNRM2_RETURNS_DOUBLE) 876c737031SSatish Balay BLAS_EXTERN double BLASasum_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 8851da93a6SBarry Smith #else 896c737031SSatish Balay BLAS_EXTERN PetscReal BLASasum_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 9051da93a6SBarry Smith #endif 916c737031SSatish Balay BLAS_EXTERN void LAPACKpttrf_(const PetscBLASInt*,PetscReal*,PetscScalar*,const PetscBLASInt*); 923c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_STEIN) 936c737031SSatish 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*); 943c377650SSatish Balay #else 953c377650SSatish 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) 963c377650SSatish Balay #endif 976c737031SSatish Balay BLAS_EXTERN void LAPACKgesv_(const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*); 98c35b00c6SBarry Smith 996c737031SSatish Balay BLAS_EXTERN void LAPACKpotrf_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1006c737031SSatish Balay BLAS_EXTERN void LAPACKpotri_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1016c737031SSatish Balay BLAS_EXTERN void LAPACKpotrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1026c737031SSatish Balay BLAS_EXTERN void LAPACKsytrf_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1036c737031SSatish Balay BLAS_EXTERN void LAPACKsytrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1043c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_SYTRI) 1056c737031SSatish Balay BLAS_EXTERN void LAPACKsytri_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*); 1063c377650SSatish Balay #else 1073c377650SSatish Balay #define LAPACKsytri_(a,b,c,d,e,f,g) PetscMissingLapack("SYTRI",a,b,c,d,e,f,g) 1083c377650SSatish Balay #endif 109916c178eSAndreas Fink BLAS_EXTERN void BLASsyrk_(const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*); 110916c178eSAndreas 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*); 1116c737031SSatish 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*); 1126c737031SSatish Balay BLAS_EXTERN void LAPACKgetrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 113916c178eSAndreas Fink BLAS_EXTERN void BLAStrmv_(const char*,const char*,const char*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*); 114916c178eSAndreas 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*); 115b9d4cb8dSJed 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*); 116916c178eSAndreas 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*); 1176c737031SSatish 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*); 1183c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_ORMQR) 119872393edSJose E. Roman BLAS_EXTERN void LAPACKormqr_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1203c377650SSatish Balay #else 1213c377650SSatish 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) 1223c377650SSatish Balay #endif 1239369748bSToby Isaac #if !defined(PETSC_MISSING_LAPACK_STEGR) 1249369748bSToby 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*); 1259369748bSToby Isaac #else 1269369748bSToby 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) 1279369748bSToby Isaac #endif 1283c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_STEQR) 1296c737031SSatish Balay BLAS_EXTERN void LAPACKsteqr_(const char*,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 1306c737031SSatish Balay BLAS_EXTERN void LAPACKREALsteqr_(const char*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 1313c377650SSatish Balay #else 1323c377650SSatish Balay #define LAPACKsteqr_(a,b,c,d,e,f,g,h) PetscMissingLapack("STEQR",a,b,c,d,e,f,g,h) 1333c377650SSatish Balay #define LAPACKREALsteqr_(a,b,c,d,e,f,g,h) PetscMissingLapack("STEQR",a,b,c,d,e,f,g,h) 1343c377650SSatish Balay #endif 1353c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_HGEQZ) 1366c737031SSatish 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 *); 1373c377650SSatish Balay #else 1383c377650SSatish 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) 1393c377650SSatish Balay #endif 1403c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TRTRS) 1416c737031SSatish Balay BLAS_EXTERN void LAPACKtrtrs_(const char *,const char *, const char *,PetscBLASInt *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscBLASInt *); 1423c377650SSatish Balay #else 1433c377650SSatish 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) 1443c377650SSatish Balay #endif 1456c737031SSatish Balay BLAS_EXTERN void LAPACKgels_(const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*); 146c35b00c6SBarry Smith 147f16551e9SSatish Balay /* handle complex dot() with special code */ 148f16551e9SSatish Balay #if defined(PETSC_USE_COMPLEX) 1499fbee547SJacob Faibussowitsch static inline PetscScalar BLASdot_(const PetscBLASInt *n,const PetscScalar *x,const PetscBLASInt *sx,const PetscScalar *y,const PetscBLASInt *sy) 150f16551e9SSatish Balay { 151f16551e9SSatish Balay PetscScalar sum=0.0; 1529669e4d8SBarry Smith PetscInt i,j,k; 153f16551e9SSatish Balay if (*sx==1 && *sy==1) { 154f16551e9SSatish Balay for (i=0; i < *n; i++) sum += PetscConj(x[i])*y[i]; 155f16551e9SSatish Balay } else { 156f16551e9SSatish Balay for (i=0,j=0,k=0; i < *n; i++,j+=*sx,k+=*sy) sum += PetscConj(x[j])*y[k]; 157f16551e9SSatish Balay } 158f16551e9SSatish Balay return sum; 159f16551e9SSatish Balay } 1609fbee547SJacob Faibussowitsch static inline PetscScalar BLASdotu_(const PetscBLASInt *n,const PetscScalar *x,const PetscBLASInt *sx,const PetscScalar *y,const PetscBLASInt *sy) 161f16551e9SSatish Balay { 162f16551e9SSatish Balay PetscScalar sum=0.0; 1639669e4d8SBarry Smith PetscInt i,j,k; 164f16551e9SSatish Balay if (*sx==1 && *sy==1) { 165f16551e9SSatish Balay for (i=0; i < *n; i++) sum += x[i]*y[i]; 166f16551e9SSatish Balay } else { 167f16551e9SSatish Balay for (i=0,j=0,k=0; i < *n; i++,j+=*sx,k+=*sy) sum += x[j]*y[k]; 168f16551e9SSatish Balay } 169f16551e9SSatish Balay return sum; 170f16551e9SSatish Balay } 171f16551e9SSatish Balay #else 17249b12944SBarry Smith #if defined(PETSC_USE_REAL_SINGLE) && defined(PETSC_BLASLAPACK_SDOT_RETURNS_DOUBLE) 1736c737031SSatish Balay BLAS_EXTERN double BLASdot_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 1746c737031SSatish Balay BLAS_EXTERN double BLASdotu_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 17549b12944SBarry Smith #else 1766c737031SSatish Balay BLAS_EXTERN PetscScalar BLASdot_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 177f16551e9SSatish Balay #endif 17849b12944SBarry Smith #endif 179f16551e9SSatish Balay 18065da4498SStefano Zampini /* Some functions prototypes do not exist for reals */ 18165da4498SStefano Zampini #if defined(PETSC_USE_COMPLEX) 1826c737031SSatish Balay BLAS_EXTERN void LAPACKhetrf_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1836c737031SSatish Balay BLAS_EXTERN void LAPACKhetrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1846c737031SSatish Balay BLAS_EXTERN void LAPACKhetri_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*); 1851153b427SDavid Wells BLAS_EXTERN void LAPACKheev_(const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 18665da4498SStefano Zampini #endif 187976cf19bSSatish Balay /* Some functions prototypes differ between real and complex */ 188976cf19bSSatish Balay #if defined(PETSC_USE_COMPLEX) 1893c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GELSS) 1906c737031SSatish 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*); 1913c377650SSatish Balay #else 1923c377650SSatish 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) 1933c377650SSatish Balay #endif 1946c737031SSatish Balay BLAS_EXTERN void LAPACKsyev_(const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 1956c737031SSatish 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*); 1966c737031SSatish Balay BLAS_EXTERN void LAPACKsygv_(PetscBLASInt*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 1976c737031SSatish 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*); 1986c737031SSatish Balay BLAS_EXTERN void LAPACKpttrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1993c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GERFS) 2006c737031SSatish Balay BLAS_EXTERN void LAPACKgerfs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscReal*,PetscBLASInt*); 2013c377650SSatish Balay #else 2023c377650SSatish 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) 2033c377650SSatish Balay #endif 2043c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TRSEN) 2056c737031SSatish Balay BLAS_EXTERN void LAPACKtrsen_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2063c377650SSatish Balay #else 2073c377650SSatish 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) 2083c377650SSatish Balay #endif 2093c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TGSEN) 2106c737031SSatish 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*); 2113c377650SSatish Balay #else 2123c377650SSatish 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) 2133c377650SSatish Balay #endif 2143c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GGES) 2156c737031SSatish 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*); 2163c377650SSatish Balay #else 2173c377650SSatish 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) 2183c377650SSatish Balay #endif 2193c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_HSEQR) 2206c737031SSatish Balay BLAS_EXTERN void LAPACKhseqr_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 221976cf19bSSatish Balay #else 2223c377650SSatish 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) 2233c377650SSatish Balay #endif 2243c377650SSatish Balay #else /* !defined(PETSC_USE_COMPLEX) */ 2253c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GELSS) 2266c737031SSatish 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*); 2273c377650SSatish Balay #else 2283c377650SSatish 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) 2293c377650SSatish Balay #endif 2306c737031SSatish Balay BLAS_EXTERN void LAPACKsyev_(const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2316c737031SSatish 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*); 2326c737031SSatish Balay BLAS_EXTERN void LAPACKsygv_(PetscBLASInt*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2336c737031SSatish 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*); 2346c737031SSatish Balay BLAS_EXTERN void LAPACKpttrs_(PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2353c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_STEBZ) 2366c737031SSatish 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*); 2373c377650SSatish Balay #else 2383c377650SSatish 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) 239976cf19bSSatish Balay #endif 2403c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GERFS) 2413c377650SSatish Balay BLAS_EXTERN void LAPACKgerfs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2423c377650SSatish Balay #else 2433c377650SSatish 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) 2443c377650SSatish Balay #endif 2453c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TRSEN) 2463c377650SSatish 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*); 2473c377650SSatish Balay #else 2483c377650SSatish 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) 2493c377650SSatish Balay #endif 2503c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TGSEN) 2513c377650SSatish 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*); 2523c377650SSatish Balay #else 2533c377650SSatish 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) 2543c377650SSatish Balay #endif 2553c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GGES) 2563c377650SSatish 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*); 2573c377650SSatish Balay #else 2583c377650SSatish 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) 2593c377650SSatish Balay #endif 2603c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_HSEQR) 2613c377650SSatish Balay BLAS_EXTERN void LAPACKhseqr_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2623c377650SSatish Balay #else 2633c377650SSatish 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) 2643c377650SSatish Balay #endif 2653c377650SSatish Balay #endif /* defined(PETSC_USE_COMPLEX) */ 266976cf19bSSatish Balay 2671148afceSStefano Zampini #if defined(PETSC_USE_COMPLEX) 2686c737031SSatish Balay BLAS_EXTERN void LAPACKgeev_(const char*,const char*,PetscBLASInt *,PetscScalar *,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 269e2b200f6SPierre 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*); 270976cf19bSSatish Balay #else 2716c737031SSatish Balay BLAS_EXTERN void LAPACKgeev_(const char*,const char*,PetscBLASInt *,PetscScalar *,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 272e2b200f6SPierre 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*); 273c35b00c6SBarry Smith #endif 274c35b00c6SBarry Smith 275c35b00c6SBarry Smith #endif 276