aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/btl/libs/C_BLAS
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-08-04 23:12:48 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-08-04 23:12:48 +0000
commita7a05382d1c51964bf3ea0536c6ddd9cc9888b72 (patch)
tree413a9ecf342bf59ff685495eff70f999ee7803ac /bench/btl/libs/C_BLAS
parentc2f8ecf46683adcab0db05199ee2ebe15e6ada4a (diff)
Add a LU decomposition action in BTL and various cleaning in BTL. For instance
all per plot settings have been moved to a single file, go_mean now takes an optional second argument "tiny" to generate plots for tiny matrices, and output of comparison information wrt to previous benchs (if any).
Diffstat (limited to 'bench/btl/libs/C_BLAS')
-rw-r--r--bench/btl/libs/C_BLAS/C_BLAS_interface.hh18
-rw-r--r--bench/btl/libs/C_BLAS/main.cpp6
2 files changed, 21 insertions, 3 deletions
diff --git a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh
index a3ea73740..21d9bde1a 100644
--- a/bench/btl/libs/C_BLAS/C_BLAS_interface.hh
+++ b/bench/btl/libs/C_BLAS/C_BLAS_interface.hh
@@ -50,6 +50,11 @@ void scopy_(const int *n, const float *x, const int *incx, float *y, const int *
void dpotrf_(const char* uplo, const int* n, double *a, const int* ld, int* info);
void ssytrd_(char *uplo, const int *n, float *a, const int *lda, float *d, float *e, float *tau, float *work, int *lwork, int *info );
void sgehrd_( const int *n, int *ilo, int *ihi, float *a, const int *lda, float *tau, float *work, int *lwork, int *info );
+
+ // LU row pivoting
+ void sgetrf_(const int* m, const int* n, float *a, const int* ld, int* ipivot, int* info);
+ // LU full pivoting
+ void sgetc2_(const int* n, float *a, const int *lda, int *ipiv, int *jpiv, int*info );
#ifdef HAS_LAPACK
#endif
}
@@ -193,7 +198,8 @@ public :
}
static inline void cholesky(const gene_vector & X, gene_vector & C, int N){
- cblas_scopy(N*N, X, 1, C, 1);
+ int N2 = N*N;
+ scopy_(&N2, X, &intone, C, &intone);
char uplo = 'L';
int info = 0;
spotrf_(&uplo, &N, C, &N, &info);
@@ -201,6 +207,16 @@ public :
#ifdef HAS_LAPACK
+ static inline void lu_decomp(const gene_matrix & X, gene_matrix & C, int N){
+ int N2 = N*N;
+ scopy_(&N2, X, &intone, C, &intone);
+ char uplo = 'L';
+ int info = 0;
+ int * ipiv = (int*)alloca(sizeof(int)*N);
+ int * jpiv = (int*)alloca(sizeof(int)*N);
+ sgetc2_(&N, C, &N, ipiv, jpiv, &info);
+ }
+
static inline void hessenberg(const gene_matrix & X, gene_matrix & C, int N){
cblas_scopy(N*N, X, 1, C, 1);
int info = 0;
diff --git a/bench/btl/libs/C_BLAS/main.cpp b/bench/btl/libs/C_BLAS/main.cpp
index 81b350325..21da0b4aa 100644
--- a/bench/btl/libs/C_BLAS/main.cpp
+++ b/bench/btl/libs/C_BLAS/main.cpp
@@ -23,6 +23,7 @@
#include "basic_actions.hh"
#include "action_cholesky.hh"
+#include "action_lu_decomp.hh"
#ifdef HAS_LAPACK
#include "action_hessenberg.hh"
@@ -45,9 +46,10 @@ int main()
bench<Action_trisolve<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-// bench<Action_cholesky<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
-
+ bench<Action_cholesky<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
+
#ifdef HAS_LAPACK
+ bench<Action_lu_decomp<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
bench<Action_hessenberg<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
bench<Action_tridiagonalization<C_BLAS_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT);
#endif