diff options
Diffstat (limited to 'sys/libmath/blas.c')
-rw-r--r-- | sys/libmath/blas.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/libmath/blas.c b/sys/libmath/blas.c index 43b0e70..224480b 100644 --- a/sys/libmath/blas.c +++ b/sys/libmath/blas.c @@ -6,15 +6,15 @@ #include <vendor/blas/cblas.h> -#define NCOL 2000 -#define NROW 2000 +#define NCOL 20000 +#define NROW 20000 #define NIT 2000 -#define INC 2 +#define INC 1 error main() { int i, j, nit; - double *x, *y, *m, res[2]; + double *x, *y, res[2]; clock_t t; double tprof[2] = { 0 }; @@ -23,17 +23,14 @@ main() x = malloc(sizeof(*x)*NCOL); y = malloc(sizeof(*x)*NROW); - m = malloc(sizeof(*x)*NROW*NCOL); #define DO_0 t = clock(); \ - blas·gerd(NROW/INC, NCOL/INC, 1.2, x, INC, y, INC, m, NCOL); \ - res[0] += m[0]; \ + res[0] += blas·dasum(NROW/INC, x, INC); \ t = clock() - t; \ tprof[0] += 1000.*t/CLOCKS_PER_SEC; \ #define DO_1 t = clock(); \ - cblas_dger(CblasRowMajor, NROW/INC, NCOL/INC, 1.2, x, INC, y, INC, m, NCOL); \ - res[1] += m[0]; \ + res[1] += cblas_dasum(NROW/INC, x, INC); \ t = clock() - t; \ tprof[1] += 1000.*t/CLOCKS_PER_SEC; @@ -41,9 +38,6 @@ main() for (i = 0; i < NROW; i++) { x[i] = rng·random(); y[i] = rng·random(); - for (j = 0; j < NCOL; j++) { - m[j + NCOL*i] = rng·random(); - } } switch (nit % 2) { |