aboutsummaryrefslogtreecommitdiff
path: root/redist/test_dcl.c
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2018-03-17 14:44:10 -0400
committercnlohr <lohr85@gmail.com>2018-03-17 14:44:10 -0400
commitf6586a91478b1ca5920c58f90925deaafab81465 (patch)
treed91b6e61768f9f3beeda446947e3ac3ff3f77dbf /redist/test_dcl.c
parent04bd16aeb391e67716344268cf0f43d1f31f180a (diff)
downloadlibsurvive-f6586a91478b1ca5920c58f90925deaafab81465.tar.gz
libsurvive-f6586a91478b1ca5920c58f90925deaafab81465.tar.bz2
Update tests... seems to work with both cblas and dclapack... Still haven't checked outputs.
Diffstat (limited to 'redist/test_dcl.c')
-rw-r--r--redist/test_dcl.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/redist/test_dcl.c b/redist/test_dcl.c
index 6b0d870..29c3c72 100644
--- a/redist/test_dcl.c
+++ b/redist/test_dcl.c
@@ -1,8 +1,13 @@
+//gcc -msse2 -O3 -ftree-vectorize test_dcl.c dclhelpers.c os_generic.c -DFLT=double -lpthread -lcblas && valgrind ./a.out
+
+
#include "dclhelpers.h"
#include <assert.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
+#include "os_generic.h"
+#include <cblas.h>
int main()
{
@@ -61,7 +66,7 @@ int main()
}
-#if 0
+#if 1
//Currently failing test...
{
@@ -70,8 +75,8 @@ int main()
// FLT emo[4][2];
FLT em1[12][20];
- FLT em2[20][12];
- FLT emo[20][12];
+ FLT em2[20][20];
+ FLT emo[20][20];
int x, y;
for( y = 0; y < 12; y++ )
@@ -79,9 +84,13 @@ int main()
em1[y][x] = (rand()%1000)/1000.0;
for( y = 0; y < 20; y++ )
- for( x = 0; x < 12; x++ )
+ for( x = 0; x < 20; x++ )
em2[y][x] = (rand()%1000)/1000.0;
+ for( y = 0; y < 20; y++ )
+ for( x = 0; x < 20; x++ )
+ emo[y][x] = 0;
+
int m = 12;
int n = 20;
int k = 12;
@@ -89,7 +98,23 @@ int main()
dclPrint( em1[0], 20, 12, 20 );
dclPrint( em2[0], 12, 20, 12 );
- dcldgemm( 0, 0, m, n, k, 1.0, em1[0], 20, em2[0], 12, .1, emo[0], 12 );
+ int i;
+
+ double start = OGGetAbsoluteTime();
+ for( i = 0; i < 10000; i++ )
+ {
+ dcldgemm( 0, 0, m, n, k, 1.0, DMS(em1), DMS(em2), .1, DMS(emo) );
+ //cblas_dgemm( CblasRowMajor, CblasNoTrans, CblasNoTrans, m, n, k, 1.0, DMS(em1), DMS(em2), .1, DMS(emo) );
+
+/*void cblas_dgemm(CBLAS_LAYOUT layout, CBLAS_TRANSPOSE TransA,
+ CBLAS_TRANSPOSE TransB, const int M, const int N,
+ const int K, const double alpha, const double *A,
+ const int lda, const double *B, const int ldb,
+ const double beta, double *C, const int ldc);*/
+
+ }
+ printf( "Elapsed: %f\n", OGGetAbsoluteTime()-start );
+
dclPrint( emo[0], 12, 20, 12 );
}
#endif