Changeset 256


Ignore:
Timestamp:
Apr 11, 2017 10:02:59 AM (5 years ago)
Author:
ferreau
Message:

further streamlining of LAPACK/BLAS replacements also in qpOASES_e branch, allowing to change function names in case replacements are use (and also LAPACK/BLAS are linking within the same project)

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/qpOASES_e/trunk/include/qpOASES_e/Matrices.h

    r250 r256  
    3838#define QPOASES_MATRICES_H
    3939
     40
     41#ifdef __AVOID_LA_NAMING_CONFLICTS__
     42
     43        #define SGEMM  qpOASES_sgemm
     44        #define DGEMM  qpOASES_gemm
     45        #define SPOTRF qpOASES_spotrf
     46        #define DPOTRF qpOASES_dpotrf
     47
     48#else
     49
     50        #define SGEMM  sgemm_
     51        #define DGEMM  gemm_
     52        #define SPOTRF spotrf_
     53        #define DPOTRF dpotrf_
     54
     55#endif
     56
     57
    4058#ifdef __USE_SINGLE_PRECISION__
    4159
    4260        /** Macro for calling level 3 BLAS operation in single precision. */
    43         #define GEMM sgemm_
     61        #define GEMM  SGEMM
    4462        /** Macro for calling level 3 BLAS operation in single precision. */
    45         #define SYR ssyr_
    46         /** Macro for calling level 3 BLAS operation in single precision. */
    47         #define SYR2 ssyr2_
    48         /** Macro for calling level 3 BLAS operation in single precision. */
    49         #define POTRF spotrf_
     63        #define POTRF SPOTRF
    5064
    5165#else
    5266
    5367        /** Macro for calling level 3 BLAS operation in double precision. */
    54         #define GEMM dgemm_
     68        #define GEMM  DGEMM
    5569        /** Macro for calling level 3 BLAS operation in double precision. */
    56         #define SYR  dsyr_
    57         /** Macro for calling level 3 BLAS operation in double precision. */
    58         #define SYR2 dsyr2_
    59         /** Macro for calling level 3 BLAS operation in double precision. */
    60         #define POTRF dpotrf_
     70        #define POTRF DPOTRF
    6171
    6272#endif /* __USE_SINGLE_PRECISION__ */
     
    6474
    6575        /** Performs one of the matrix-matrix operation in double precision. */
    66         void dgemm_ ( const char*, const char*, const unsigned long*, const unsigned long*, const unsigned long*,
    67                         const double*, const double*, const unsigned long*, const double*, const unsigned long*,
    68                         const double*, double*, const unsigned long* );
     76        void DGEMM(             const char*, const char*, const unsigned long*, const unsigned long*, const unsigned long*,
     77                                        const double*, const double*, const unsigned long*, const double*, const unsigned long*,
     78                                        const double*, double*, const unsigned long* );
    6979        /** Performs one of the matrix-matrix operation in single precision. */
    70         void sgemm_ ( const char*, const char*, const unsigned long*, const unsigned long*, const unsigned long*,
    71                         const float*, const float*, const unsigned long*, const float*, const unsigned long*,
    72                         const float*, float*, const unsigned long* );
    73 
    74         /** Performs a symmetric rank 1 operation in double precision. */
    75         void dsyr_ ( const char *, const unsigned long *, const double *, const double *,
    76                                  const unsigned long *, double *, const unsigned long *);
    77         /** Performs a symmetric rank 1 operation in single precision. */
    78         void ssyr_ ( const char *, const unsigned long *, const float *, const float *,
    79                                  const unsigned long *, float *, const unsigned long *);
    80 
    81         /** Performs a symmetric rank 2 operation in double precision. */
    82         void dsyr2_ ( const char *, const unsigned long *, const double *, const double *,
    83                                   const unsigned long *, const double *, const unsigned long *, double *, const unsigned long *);
    84         /** Performs a symmetric rank 2 operation in single precision. */
    85         void ssyr2_ ( const char *, const unsigned long *, const float *, const float *,
    86                                   const unsigned long *, const float *, const unsigned long *, float *, const unsigned long *);
     80        void SGEMM (    const char*, const char*, const unsigned long*, const unsigned long*, const unsigned long*,
     81                                        const float*, const float*, const unsigned long*, const float*, const unsigned long*,
     82                                        const float*, float*, const unsigned long* );
    8783
    8884        /** Calculates the Cholesky factorization of a real symmetric positive definite matrix in double precision. */
    89         void dpotrf_ ( const char *, const unsigned long *, double *, const unsigned long *, long * );
     85        void DPOTRF(    const char*, const unsigned long*, double*, const unsigned long*, long* );
    9086        /** Calculates the Cholesky factorization of a real symmetric positive definite matrix in single precision. */
    91         void spotrf_ ( const char *, const unsigned long *, float *, const unsigned long *, long * );
     87        void SPOTRF(    const char*, const unsigned long*, float*, const unsigned long*, long* );
    9288
    9389
     
    274270
    275271#endif  /* QPOASES_MATRICES_H */
     272
     273
     274/*
     275 *      end of file
     276 */
  • branches/qpOASES_e/trunk/src/Matrices.c

    r250 r256  
    529529
    530530
    531 void dgemm_(    const char *TRANSA, const char *TRANSB,
    532                                 const unsigned long *M, const unsigned long *N, const unsigned long *K,
    533                                 const double *ALPHA, const double *A, const unsigned long *LDA, const double *B, const unsigned long *LDB,
    534                                 const double *BETA, double *C, const unsigned long *LDC
    535                                 )
     531void DGEMM(     const char* TRANSA, const char* TRANSB,
     532                        const unsigned long* M, const unsigned long* N, const unsigned long* K,
     533                        const double* ALPHA, const double* A, const unsigned long* LDA, const double* B, const unsigned long* LDB,
     534                        const double* BETA, double* C, const unsigned long* LDC
     535                        )
    536536{
    537537        unsigned int i, j, k;
     
    584584}
    585585
    586 void sgemm_(    const char *TRANSA, const char *TRANSB,
    587                                 const unsigned long *M, const unsigned long *N, const unsigned long *K,
    588                                 const float *ALPHA, const float *A, const unsigned long *LDA, const float *B, const unsigned long *LDB,
    589                                 const float *BETA, float *C, const unsigned long *LDC
    590                                 )
     586void SGEMM(     const char* TRANSA, const char* TRANSB,
     587                        const unsigned long* M, const unsigned long* N, const unsigned long* K,
     588                        const float* ALPHA, const float* A, const unsigned long* LDA, const float* B, const unsigned long* LDB,
     589                        const float* BETA, float* C, const unsigned long* LDC
     590                        )
    591591{
    592592        unsigned int i, j, k;
     
    641641
    642642
    643 void dpotrf_(   const char *uplo, const unsigned long *_n, double *a,
    644                                 const unsigned long *_lda, long *info
     643void DPOTRF(    const char* uplo, const unsigned long* _n, double* a,
     644                                const unsigned long* _lda, long* info
    645645                                )
    646646{
     
    683683
    684684
    685 void spotrf_(   const char *uplo, const unsigned long *_n, float *a,
    686                                 const unsigned long *_lda, long *info
     685void SPOTRF(    const char* uplo, const unsigned long* _n, float* a,
     686                                const unsigned long* _lda, long* info
    687687                                )
    688688{
  • trunk/include/qpOASES/LapackBlasReplacement.hpp

    r255 r256  
    6666
    6767        /** Macro for calling level 3 BLAS operation in single precision. */
    68         #define GEMM SGEMM
     68        #define GEMM  SGEMM
    6969        /** Macro for calling level 3 BLAS operation in single precision. */
    7070        #define POTRF SPOTRF
     
    7878
    7979        /** Macro for calling level 3 BLAS operation in double precision. */
    80         #define GEMM DGEMM
     80        #define GEMM  DGEMM
    8181        /** Macro for calling level 3 BLAS operation in double precision. */
    8282        #define POTRF DPOTRF
Note: See TracChangeset for help on using the changeset viewer.