From 8ac87c1cb63fd8518c7a99d6b06fb47524f2153b Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 16 Oct 2017 23:27:51 +0200 Subject: [PATCH] Implement DSDOT with unchanged sdot microkernels --- kernel/x86_64/sdot.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/kernel/x86_64/sdot.c b/kernel/x86_64/sdot.c index 389252f..f786d18 100644 --- a/kernel/x86_64/sdot.c +++ b/kernel/x86_64/sdot.c @@ -68,7 +68,11 @@ static void sdot_kernel_16(BLASLONG n, FLOAT *x, FLOAT *y, FLOAT *d) #endif +#if defined (DSDOT) +double CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y) +#else FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y) +#endif { BLASLONG i=0; BLASLONG ix=0,iy=0; @@ -91,12 +95,19 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y) i = n1; while(i < n) { - +#if defined(DSDOT) + dot += (double)y[i] * (double)x[i] ; +#else dot += y[i] * x[i] ; +#endif i++ ; } +#if defined(DSDOT) + dot+=(double)mydot; +#else dot+=mydot; +#endif return(dot); @@ -106,8 +117,11 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y) while(i < n1) { - +#if defined (DSDOT) + dot += (double)y[iy] * (double)x[ix] + (double)y[iy+inc_y] * (double)x[ix+inc_x]; +#else dot += y[iy] * x[ix] + y[iy+inc_y] * x[ix+inc_x]; +#endif ix += inc_x*2 ; iy += inc_y*2 ; i+=2 ; @@ -116,8 +130,11 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y) while(i < n) { - +#if defined (DSDOT) + dot += (double)y[iy] * (double)x[ix] ; +#else dot += y[iy] * x[ix] ; +#endif ix += inc_x ; iy += inc_y ; i++ ; -- 2.7.4