mirror of
https://github.com/opencv/opencv.git
synced 2024-12-13 16:09:23 +08:00
2ee9d21dae
Added clapack * bring a small subset of Lapack, automatically converted to C, into OpenCV * added missing lsame_ prototype * * small fix in make_clapack script * trying to fix remaining CI problems * fixed character arrays' initializers * get rid of F2C_STR_MAX * * added back single-precision versions for QR, LU and Cholesky decompositions. It adds very little extra overhead. * added stub version of sdesdd. * uncommented calls to all the single-precision Lapack functions from opencv/core/src/hal_internal.cpp. * fixed warning from Visual Studio + cleaned f2c runtime a bit * * regenerated Lapack w/o forward declarations of intrinsic functions (such as sqrt(), r_cnjg() etc.) * at once, trailing whitespaces are removed from the generated sources, just in case * since there is no declarations of intrinsic functions anymore, we could turn some of them into inline functions * trying to eliminate the crash on ARM * fixed API and semantics of s_copy * * CLapack has been tested successfully. It's now time to restore the standard LAPACK detection procedure * removed some more trailing whitespaces * * retained only the essential stuff in CLapack * added checks to lapack calls to gracefully return "not implemented" instead of returning invalid results with "ok" status * disabled warning when building lapack * cmake: update LAPACK detection Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
103 lines
3.3 KiB
C
103 lines
3.3 KiB
C
#ifndef __CBLAS_H__
|
|
#define __CBLAS_H__
|
|
|
|
/* most of the stuff is in lapacke.h */
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct lapack_complex
|
|
{
|
|
float r, i;
|
|
} lapack_complex;
|
|
|
|
typedef struct lapack_doublecomplex
|
|
{
|
|
double r, i;
|
|
} lapack_doublecomplex;
|
|
|
|
typedef enum {CblasRowMajor=101, CblasColMajor=102} CBLAS_LAYOUT;
|
|
typedef enum {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113} CBLAS_TRANSPOSE;
|
|
|
|
void cblas_xerbla(const CBLAS_LAYOUT layout, int info,
|
|
const char *rout, const char *form, ...);
|
|
|
|
void cblas_sgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA,
|
|
CBLAS_TRANSPOSE TransB, const int M, const int N,
|
|
const int K, const float alpha, const float *A,
|
|
const int lda, const float *B, const int ldb,
|
|
const float beta, float *C, const int ldc);
|
|
|
|
void cblas_dgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA,
|
|
CBLAS_TRANSPOSE TransB, const int M, const int N,
|
|
const int K, const double alpha, const double *A,
|
|
const int lda, const double *B, const int ldb,
|
|
const double beta, double *C, const int ldc);
|
|
|
|
void cblas_cgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA,
|
|
CBLAS_TRANSPOSE TransB, const int M, const int N,
|
|
const int K, const void *alpha, const void *A,
|
|
const int lda, const void *B, const int ldb,
|
|
const void *beta, void *C, const int ldc);
|
|
|
|
void cblas_zgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA,
|
|
CBLAS_TRANSPOSE TransB, const int M, const int N,
|
|
const int K, const void *alpha, const void *A,
|
|
const int lda, const void *B, const int ldb,
|
|
const void *beta, void *C, const int ldc);
|
|
|
|
int xerbla_(char *, int *);
|
|
int lsame_(char *, char *);
|
|
double slamch_(char* cmach);
|
|
double slamc3_(float *a, float *b);
|
|
double dlamch_(char* cmach);
|
|
double dlamc3_(double *a, double *b);
|
|
|
|
int dgels_(char *trans, int *m, int *n, int *nrhs, double *a,
|
|
int *lda, double *b, int *ldb, double *work, int *lwork, int *info);
|
|
|
|
int dgesv_(int *n, int *nrhs, double *a, int *lda, int *ipiv,
|
|
double *b, int *ldb, int *info);
|
|
|
|
int dgetrf_(int *m, int *n, double *a, int *lda, int *ipiv,
|
|
int *info);
|
|
|
|
int dposv_(char *uplo, int *n, int *nrhs, double *a, int *
|
|
lda, double *b, int *ldb, int *info);
|
|
|
|
int dpotrf_(char *uplo, int *n, double *a, int *lda, int *
|
|
info);
|
|
|
|
int sgels_(char *trans, int *m, int *n, int *nrhs, float *a,
|
|
int *lda, float *b, int *ldb, float *work, int *lwork, int *info);
|
|
|
|
int sgeev_(char *jobvl, char *jobvr, int *n, float *a, int *
|
|
lda, float *wr, float *wi, float *vl, int *ldvl, float *vr, int *
|
|
ldvr, float *work, int *lwork, int *info);
|
|
|
|
int sgeqrf_(int *m, int *n, float *a, int *lda, float *tau,
|
|
float *work, int *lwork, int *info);
|
|
|
|
int sgesv_(int *n, int *nrhs, float *a, int *lda, int *ipiv,
|
|
float *b, int *ldb, int *info);
|
|
|
|
int sgetrf_(int *m, int *n, float *a, int *lda, int *ipiv,
|
|
int *info);
|
|
|
|
int sposv_(char *uplo, int *n, int *nrhs, float *a, int *
|
|
lda, float *b, int *ldb, int *info);
|
|
|
|
int spotrf_(char *uplo, int *n, float *a, int *lda, int *
|
|
info);
|
|
|
|
int sgesdd_(char *jobz, int *m, int *n, float *a, int *lda,
|
|
float *s, float *u, int *ldu, float *vt, int *ldvt, float *work,
|
|
int *lwork, int *iwork, int *info);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __CBLAS_H__ */
|