From 6a515e988f2ae1628258a6dec2c0e9cf2d04790f Mon Sep 17 00:00:00 2001 From: "Field G. Van Zee" Date: Sun, 13 Jul 2014 17:38:33 -0500 Subject: [PATCH] Implemented dsdot() and sdsdot() in compat layer. Details: - Replaced "not yet implemented" error messages in dsdot() and sdsdot() with actual implementations. (These routines are so rarely used that this log message will probably lead to some people learning of their existence for the first time.) --- frame/compat/bla_dot.c | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/frame/compat/bla_dot.c b/frame/compat/bla_dot.c index e58bee5d7..440a63f97 100644 --- a/frame/compat/bla_dot.c +++ b/frame/compat/bla_dot.c @@ -93,9 +93,9 @@ float PASTEF77(sd,sdot)( f77_int* n, float* y, f77_int* incy ) { - bli_check_error_code( BLIS_NOT_YET_IMPLEMENTED ); - - return 0.0F; + return ( float )PASTEF77(d,sdot)( n, + x, incx, + y, incy ); } // Input vectors stored in single precision, computed in double precision, @@ -105,9 +105,39 @@ double PASTEF77(d,sdot)( f77_int* n, float* y, f77_int* incy ) { - bli_check_error_code( BLIS_NOT_YET_IMPLEMENTED ); + dim_t n0; + float* x0; + float* y0; + inc_t incx0; + inc_t incy0; + double rho; + dim_t i; - return 0.0; + /* Initialization of BLIS is not required. */ + + /* Convert/typecast negative values of n to zero. */ + bli_convert_blas_dim1( *n, n0 ); + + /* If the input increments are negative, adjust the pointers so we can + use positive increments instead. */ + bli_convert_blas_incv( n0, x, *incx, x0, incx0 ); + bli_convert_blas_incv( n0, y, *incy, y0, incy0 ); + + rho = 0.0; + + for ( i = 0; i < n0; i++ ) + { + float* chi1 = x0 + (i )*incx0; + float* psi1 = y0 + (i )*incy0; + + bli_ddots( (( double )(*chi1)), + (( double )(*psi1)), rho ); + } + + /* Finalization of BLIS is not required, because initialization was + not required. */ + + return rho; } #endif