aboutsummaryrefslogtreecommitdiff
path: root/sys/libmath/blas.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-05-25 15:33:54 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-05-25 15:33:54 -0700
commit5e53685221576ad6ec53bafffd14bc7d5e01fa30 (patch)
tree9780092401ccd8a116fbc33a50756cf2a90985b6 /sys/libmath/blas.c
parent70148cca0463cc45408401a0f2d76ba805d0a157 (diff)
deprecated old python generation files
Diffstat (limited to 'sys/libmath/blas.c')
-rw-r--r--sys/libmath/blas.c18
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) {