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 318b83055fSJed Brown #define PetscStackCallBLAS(name,routine) do { \ 32a2f94806SJed Brown PetscStackPushNoCheck(name,PETSC_FALSE,PETSC_TRUE); \ 338b83055fSJed Brown routine; \ 348b83055fSJed Brown PetscStackPop; \ 358b83055fSJed Brown } while(0) 368b83055fSJed Brown 373c377650SSatish Balay PETSC_STATIC_INLINE void PetscMissingLapack(const char *fname,...) 383c377650SSatish Balay { 393c377650SSatish Balay char mesg[1024]; 403c377650SSatish Balay PetscSNPrintf(mesg,1024,"%s - Lapack routine is unavailable.",fname); 413c377650SSatish Balay SETERRABORT(PETSC_COMM_SELF,PETSC_ERR_SUP,mesg); 423c377650SSatish Balay } 433c377650SSatish Balay 44e5b2100bSSteven G. Johnson #include <petscblaslapack_mangle.h> 45a1e12872SBarry Smith 466c737031SSatish Balay BLAS_EXTERN void LAPACKgetrf_(PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 47b9d4cb8dSJed Brown BLAS_EXTERN void LAPACKREALgetrf_(PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*); 486c737031SSatish Balay BLAS_EXTERN void LAPACKgetri_(PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 49b9d4cb8dSJed Brown BLAS_EXTERN void LAPACKREALgetri_(PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*,PetscBLASInt*); 503c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_ORGQR) 51c964aadfSJose E. Roman BLAS_EXTERN void LAPACKorgqr_(PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 523c377650SSatish Balay #else 533c377650SSatish Balay #define LAPACKorgqr_(a,b,c,d,e,f,g,h,i) PetscMissingLapack("ORGQR",a,b,c,d,e,f,g,h,i) 543c377650SSatish Balay #endif 556c737031SSatish Balay BLAS_EXTERN void LAPACKgeqrf_(PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 5649b12944SBarry Smith #if defined(PETSC_USE_REAL_SINGLE) && defined(PETSC_BLASLAPACK_SNRM2_RETURNS_DOUBLE) 576c737031SSatish Balay BLAS_EXTERN double BLASnrm2_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 5849b12944SBarry Smith #else 596c737031SSatish Balay BLAS_EXTERN PetscReal BLASnrm2_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 6049b12944SBarry Smith #endif 616c737031SSatish Balay BLAS_EXTERN void BLASscal_(const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*); 626c737031SSatish Balay BLAS_EXTERN void BLAScopy_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*); 636c737031SSatish Balay BLAS_EXTERN void BLASswap_(const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*); 646c737031SSatish Balay BLAS_EXTERN void BLASaxpy_(const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*); 6551da93a6SBarry Smith #if defined(PETSC_USE_REAL_SINGLE) && defined(PETSC_BLASLAPACK_SNRM2_RETURNS_DOUBLE) 666c737031SSatish Balay BLAS_EXTERN double BLASasum_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 6751da93a6SBarry Smith #else 686c737031SSatish Balay BLAS_EXTERN PetscReal BLASasum_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 6951da93a6SBarry Smith #endif 706c737031SSatish Balay BLAS_EXTERN void LAPACKpttrf_(const PetscBLASInt*,PetscReal*,PetscScalar*,const PetscBLASInt*); 713c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_STEIN) 726c737031SSatish 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*); 733c377650SSatish Balay #else 743c377650SSatish 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) 753c377650SSatish Balay #endif 766c737031SSatish Balay BLAS_EXTERN void LAPACKgesv_(const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*); 77c35b00c6SBarry Smith 786c737031SSatish Balay BLAS_EXTERN void LAPACKpotrf_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 796c737031SSatish Balay BLAS_EXTERN void LAPACKpotri_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 806c737031SSatish Balay BLAS_EXTERN void LAPACKpotrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 816c737031SSatish Balay BLAS_EXTERN void LAPACKsytrf_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 826c737031SSatish Balay BLAS_EXTERN void LAPACKsytrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 833c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_SYTRI) 846c737031SSatish Balay BLAS_EXTERN void LAPACKsytri_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*); 853c377650SSatish Balay #else 863c377650SSatish Balay #define LAPACKsytri_(a,b,c,d,e,f,g) PetscMissingLapack("SYTRI",a,b,c,d,e,f,g) 873c377650SSatish Balay #endif 88916c178eSAndreas Fink BLAS_EXTERN void BLASsyrk_(const char*,const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscScalar*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,PetscScalar*,const PetscBLASInt*); 89916c178eSAndreas 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*); 906c737031SSatish 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*); 916c737031SSatish Balay BLAS_EXTERN void LAPACKgetrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 92916c178eSAndreas Fink BLAS_EXTERN void BLAStrmv_(const char*,const char*,const char*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*); 93916c178eSAndreas 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*); 94b9d4cb8dSJed 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*); 95916c178eSAndreas 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*); 966c737031SSatish 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*); 973c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_ORMQR) 98872393edSJose E. Roman BLAS_EXTERN void LAPACKormqr_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 993c377650SSatish Balay #else 1003c377650SSatish 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) 1013c377650SSatish Balay #endif 102*9369748bSToby Isaac #if !defined(PETSC_MISSING_LAPACK_STEGR) 103*9369748bSToby 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*); 104*9369748bSToby Isaac #else 105*9369748bSToby 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) 106*9369748bSToby Isaac #endif 1073c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_STEQR) 1086c737031SSatish Balay BLAS_EXTERN void LAPACKsteqr_(const char*,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 1096c737031SSatish Balay BLAS_EXTERN void LAPACKREALsteqr_(const char*,PetscBLASInt*,PetscReal*,PetscReal*,PetscReal*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 1103c377650SSatish Balay #else 1113c377650SSatish Balay #define LAPACKsteqr_(a,b,c,d,e,f,g,h) PetscMissingLapack("STEQR",a,b,c,d,e,f,g,h) 1123c377650SSatish Balay #define LAPACKREALsteqr_(a,b,c,d,e,f,g,h) PetscMissingLapack("STEQR",a,b,c,d,e,f,g,h) 1133c377650SSatish Balay #endif 1143c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_HGEQZ) 1156c737031SSatish 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 *); 1163c377650SSatish Balay #else 1173c377650SSatish 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) 1183c377650SSatish Balay #endif 1193c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TRTRS) 1206c737031SSatish Balay BLAS_EXTERN void LAPACKtrtrs_(const char *,const char *, const char *,PetscBLASInt *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscScalar *,PetscBLASInt *,PetscBLASInt *); 1213c377650SSatish Balay #else 1223c377650SSatish 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) 1233c377650SSatish Balay #endif 1246c737031SSatish Balay BLAS_EXTERN void LAPACKgels_(const char*,const PetscBLASInt*,const PetscBLASInt*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscScalar*,const PetscBLASInt*,PetscBLASInt*); 125c35b00c6SBarry Smith 126f16551e9SSatish Balay /* handle complex dot() with special code */ 127f16551e9SSatish Balay #if defined(PETSC_USE_COMPLEX) 128f16551e9SSatish Balay PETSC_STATIC_INLINE PetscScalar BLASdot_(const PetscBLASInt *n,const PetscScalar *x,const PetscBLASInt *sx,const PetscScalar *y,const PetscBLASInt *sy) 129f16551e9SSatish Balay { 130f16551e9SSatish Balay PetscScalar sum=0.0; 1319669e4d8SBarry Smith PetscInt i,j,k; 132f16551e9SSatish Balay if (*sx==1 && *sy==1) { 133f16551e9SSatish Balay for (i=0; i < *n; i++) sum += PetscConj(x[i])*y[i]; 134f16551e9SSatish Balay } else { 135f16551e9SSatish Balay for (i=0,j=0,k=0; i < *n; i++,j+=*sx,k+=*sy) sum += PetscConj(x[j])*y[k]; 136f16551e9SSatish Balay } 137f16551e9SSatish Balay return sum; 138f16551e9SSatish Balay } 139f16551e9SSatish Balay PETSC_STATIC_INLINE PetscScalar BLASdotu_(const PetscBLASInt *n,const PetscScalar *x,const PetscBLASInt *sx,const PetscScalar *y,const PetscBLASInt *sy) 140f16551e9SSatish Balay { 141f16551e9SSatish Balay PetscScalar sum=0.0; 1429669e4d8SBarry Smith PetscInt i,j,k; 143f16551e9SSatish Balay if (*sx==1 && *sy==1) { 144f16551e9SSatish Balay for (i=0; i < *n; i++) sum += x[i]*y[i]; 145f16551e9SSatish Balay } else { 146f16551e9SSatish Balay for (i=0,j=0,k=0; i < *n; i++,j+=*sx,k+=*sy) sum += x[j]*y[k]; 147f16551e9SSatish Balay } 148f16551e9SSatish Balay return sum; 149f16551e9SSatish Balay } 150f16551e9SSatish Balay #else 15149b12944SBarry Smith #if defined(PETSC_USE_REAL_SINGLE) && defined(PETSC_BLASLAPACK_SDOT_RETURNS_DOUBLE) 1526c737031SSatish Balay BLAS_EXTERN double BLASdot_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 1536c737031SSatish Balay BLAS_EXTERN double BLASdotu_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 15449b12944SBarry Smith #else 1556c737031SSatish Balay BLAS_EXTERN PetscScalar BLASdot_(const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*,const PetscScalar*,const PetscBLASInt*); 156f16551e9SSatish Balay #endif 15749b12944SBarry Smith #endif 158f16551e9SSatish Balay 15965da4498SStefano Zampini /* Some functions prototypes do not exist for reals */ 16065da4498SStefano Zampini #if defined(PETSC_USE_COMPLEX) 1616c737031SSatish Balay BLAS_EXTERN void LAPACKhetrf_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1626c737031SSatish Balay BLAS_EXTERN void LAPACKhetrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1636c737031SSatish Balay BLAS_EXTERN void LAPACKhetri_(const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*); 16465da4498SStefano Zampini #endif 165976cf19bSSatish Balay /* Some functions prototypes differ between real and complex */ 166976cf19bSSatish Balay #if defined(PETSC_USE_COMPLEX) 1673c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GELSS) 1686c737031SSatish 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*); 1693c377650SSatish Balay #else 1703c377650SSatish 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) 1713c377650SSatish Balay #endif 1726c737031SSatish Balay BLAS_EXTERN void LAPACKsyev_(const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 1736c737031SSatish 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*); 1746c737031SSatish Balay BLAS_EXTERN void LAPACKsygv_(PetscBLASInt*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 1756c737031SSatish 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*); 1766c737031SSatish Balay BLAS_EXTERN void LAPACKpttrs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1773c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GERFS) 1786c737031SSatish Balay BLAS_EXTERN void LAPACKgerfs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscReal*,PetscBLASInt*); 1793c377650SSatish Balay #else 1803c377650SSatish 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) 1813c377650SSatish Balay #endif 1823c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TRSEN) 1836c737031SSatish Balay BLAS_EXTERN void LAPACKtrsen_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 1843c377650SSatish Balay #else 1853c377650SSatish 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) 1863c377650SSatish Balay #endif 1873c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TGSEN) 1886c737031SSatish 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*); 1893c377650SSatish Balay #else 1903c377650SSatish 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) 1913c377650SSatish Balay #endif 1923c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GGES) 1936c737031SSatish 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*); 1943c377650SSatish Balay #else 1953c377650SSatish 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) 1963c377650SSatish Balay #endif 1973c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_HSEQR) 1986c737031SSatish Balay BLAS_EXTERN void LAPACKhseqr_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 199976cf19bSSatish Balay #else 2003c377650SSatish 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) 2013c377650SSatish Balay #endif 2023c377650SSatish Balay #else /* !defined(PETSC_USE_COMPLEX) */ 2033c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GELSS) 2046c737031SSatish 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*); 2053c377650SSatish Balay #else 2063c377650SSatish 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) 2073c377650SSatish Balay #endif 2086c737031SSatish Balay BLAS_EXTERN void LAPACKsyev_(const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2096c737031SSatish 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*); 2106c737031SSatish Balay BLAS_EXTERN void LAPACKsygv_(PetscBLASInt*,const char*,const char*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2116c737031SSatish 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*); 2126c737031SSatish Balay BLAS_EXTERN void LAPACKpttrs_(PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2133c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_STEBZ) 2146c737031SSatish 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*); 2153c377650SSatish Balay #else 2163c377650SSatish 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) 217976cf19bSSatish Balay #endif 2183c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GERFS) 2193c377650SSatish Balay BLAS_EXTERN void LAPACKgerfs_(const char*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2203c377650SSatish Balay #else 2213c377650SSatish 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) 2223c377650SSatish Balay #endif 2233c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TRSEN) 2243c377650SSatish 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*); 2253c377650SSatish Balay #else 2263c377650SSatish 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) 2273c377650SSatish Balay #endif 2283c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_TGSEN) 2293c377650SSatish 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*); 2303c377650SSatish Balay #else 2313c377650SSatish 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) 2323c377650SSatish Balay #endif 2333c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_GGES) 2343c377650SSatish 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*); 2353c377650SSatish Balay #else 2363c377650SSatish 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) 2373c377650SSatish Balay #endif 2383c377650SSatish Balay #if !defined(PETSC_MISSING_LAPACK_HSEQR) 2393c377650SSatish Balay BLAS_EXTERN void LAPACKhseqr_(const char*,const char*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2403c377650SSatish Balay #else 2413c377650SSatish 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) 2423c377650SSatish Balay #endif 2433c377650SSatish Balay #endif /* defined(PETSC_USE_COMPLEX) */ 244976cf19bSSatish Balay 245c35b00c6SBarry Smith /* ESSL uses a different calling sequence for dgeev(), zgeev() than LAPACK; */ 246c35b00c6SBarry Smith #if defined(PETSC_HAVE_ESSL) && defined(PETSC_USE_COMPLEX) 2476c737031SSatish Balay BLAS_EXTERN void LAPACKgeev_(PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 2486c737031SSatish Balay BLAS_EXTERN void LAPACKgesvd_(const char*,const char*,PetscBLASInt *,PetscBLASInt*,PetscScalar *,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 249c35b00c6SBarry Smith #elif defined(PETSC_HAVE_ESSL) 2506c737031SSatish Balay BLAS_EXTERN void LAPACKgeev_(PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscBLASInt*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 2516c737031SSatish Balay BLAS_EXTERN void LAPACKgesvd_(const char*,const char*,PetscBLASInt *,PetscBLASInt*,PetscScalar *,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 252976cf19bSSatish Balay #elif defined(PETSC_USE_COMPLEX) 2536c737031SSatish Balay BLAS_EXTERN void LAPACKgeev_(const char*,const char*,PetscBLASInt *,PetscScalar *,PetscBLASInt*,PetscScalar*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 2546c737031SSatish Balay BLAS_EXTERN void LAPACKgesvd_(const char*,const char*,PetscBLASInt *,PetscBLASInt*,PetscScalar *,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscReal*,PetscBLASInt*); 255976cf19bSSatish Balay #else 2566c737031SSatish Balay BLAS_EXTERN void LAPACKgeev_(const char*,const char*,PetscBLASInt *,PetscScalar *,PetscBLASInt*,PetscReal*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 2576c737031SSatish Balay BLAS_EXTERN void LAPACKgesvd_(const char*,const char*,PetscBLASInt *,PetscBLASInt*,PetscScalar *,PetscBLASInt*,PetscReal*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscScalar*,PetscBLASInt*,PetscBLASInt*); 258c35b00c6SBarry Smith #endif 259c35b00c6SBarry Smith 260c35b00c6SBarry Smith #endif 261