diff options
author | Justin Berger <j.david.berger@gmail.com> | 2018-03-17 09:32:22 -0600 |
---|---|---|
committer | Justin Berger <j.david.berger@gmail.com> | 2018-03-17 09:32:22 -0600 |
commit | 0b9e66ad2ff686a4dcf8a6838f33edb203a1bff5 (patch) | |
tree | 2ccc16e01e625901f00c59cc85535286116b1792 /redist/test_dcl.c | |
parent | 7c97cfe7f63650fc79ce4fa7f081b556ce275475 (diff) | |
download | libsurvive-0b9e66ad2ff686a4dcf8a6838f33edb203a1bff5.tar.gz libsurvive-0b9e66ad2ff686a4dcf8a6838f33edb203a1bff5.tar.bz2 |
Fixed gemm
Diffstat (limited to 'redist/test_dcl.c')
-rw-r--r-- | redist/test_dcl.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/redist/test_dcl.c b/redist/test_dcl.c index 6d49548..42f4fd6 100644 --- a/redist/test_dcl.c +++ b/redist/test_dcl.c @@ -1,5 +1,6 @@ #include "dclhelpers.h" #include <assert.h> +#include <math.h> #include <stdint.h> #include <stdio.h> @@ -36,18 +37,24 @@ int main() dclIdentity(A[0], 4, 3); dclPrint(A[0], 4, 3, 4); - FLT x[4] = {7, 8, 9, 10}; - FLT R[4]; + FLT x[4][2] = { + {7, -7}, {8, -8}, {9, -9}, {10, -10}, + }; + FLT R[4][2]; + printf("%p %p %p\n", A, x, R); // dclMul(R, 1, A[0], 4, x, 1, 4, 1, 3); - dcldgemm(0, 0, 4, 1, 3, 1, A[0], 4, x, 1, 0, R, 1); + dcldgemm(0, 0, 3, 4, 2, 1, A[0], 4, x[0], 2, 0, R[0], 2); - dclPrint(x, 1, 4, 1); - dclPrint(R, 1, 4, 1); + dclPrint(x[0], 2, 4, 2); + dclPrint(R[0], 2, 4, 2); - for (int i = 0; i < 3; i++) - assert(R[i] == x[i]); - assert(R[3] == 0.); + for (int j = 0; j < 2; j++) { + for (int i = 0; i < 3; i++) + assert(R[i][j] == x[i][j]); + + assert(fabs(R[3][j]) < .0000001); + } } // void dclTransp( DCL_FLOAT * R, int Rc, const DCL_FLOAT * A, int Ac, int n, int m ); |