Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58586 - in sandbox/numeric_bindings/boost/numeric/bindings/blas: detail level1
From: rutger_at_[hidden]
Date: 2009-12-30 10:31:32


Author: rutger
Date: 2009-12-30 10:31:31 EST (Wed, 30 Dec 2009)
New Revision: 58586
URL: http://svn.boost.org/trac/boost/changeset/58586

Log:
updated blas bindings with updates to cblas' backend routines of dotc, dotu

Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas.h | 8 +++---
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dotc.hpp | 44 +++++++++++++++++++++------------------
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dotu.hpp | 44 +++++++++++++++++++++------------------
   3 files changed, 52 insertions(+), 44 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas.h
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas.h (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas.h 2009-12-30 10:31:31 EST (Wed, 30 Dec 2009)
@@ -57,18 +57,18 @@
         const std::ptrdiff_t* incy );
 
 // Value-type variants of dotc
-void BLAS_CDOTC( const std::ptrdiff_t* n, const void* x,
+std::complex<float> BLAS_CDOTC( const std::ptrdiff_t* n, const void* x,
         const std::ptrdiff_t* incx, const void* y,
         const std::ptrdiff_t* incy );
-void BLAS_ZDOTC( const std::ptrdiff_t* n, const void* x,
+std::complex<double> BLAS_ZDOTC( const std::ptrdiff_t* n, const void* x,
         const std::ptrdiff_t* incx, const void* y,
         const std::ptrdiff_t* incy );
 
 // Value-type variants of dotu
-void BLAS_CDOTU( const std::ptrdiff_t* n, const void* x,
+std::complex<float> BLAS_CDOTU( const std::ptrdiff_t* n, const void* x,
         const std::ptrdiff_t* incx, const void* y,
         const std::ptrdiff_t* incy );
-void BLAS_ZDOTU( const std::ptrdiff_t* n, const void* x,
+std::complex<double> BLAS_ZDOTU( const std::ptrdiff_t* n, const void* x,
         const std::ptrdiff_t* incx, const void* y,
         const std::ptrdiff_t* incy );
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dotc.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dotc.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dotc.hpp 2009-12-30 10:31:31 EST (Wed, 30 Dec 2009)
@@ -59,10 +59,12 @@
 // * CBLAS backend, and
 // * complex<float> value-type.
 //
-inline void dotc( const std::ptrdiff_t n, const std::complex<float>* x,
- const std::ptrdiff_t incx, const std::complex<float>* y,
- const std::ptrdiff_t incy ) {
- return cblas_cdotc_sub( n, x, incx, y, incy );
+inline std::complex<float> dotc( const std::ptrdiff_t n,
+ const std::complex<float>* x, const std::ptrdiff_t incx,
+ const std::complex<float>* y, const std::ptrdiff_t incy ) {
+ std::complex<float> result;
+ cblas_cdotc_sub( n, x, incx, y, incy, &result );
+ return result;
 }
 
 //
@@ -70,10 +72,12 @@
 // * CBLAS backend, and
 // * complex<double> value-type.
 //
-inline void dotc( const std::ptrdiff_t n, const std::complex<double>* x,
- const std::ptrdiff_t incx, const std::complex<double>* y,
- const std::ptrdiff_t incy ) {
- return cblas_zdotc_sub( n, x, incx, y, incy );
+inline std::complex<double> dotc( const std::ptrdiff_t n,
+ const std::complex<double>* x, const std::ptrdiff_t incx,
+ const std::complex<double>* y, const std::ptrdiff_t incy ) {
+ std::complex<double> result;
+ cblas_zdotc_sub( n, x, incx, y, incy, &result );
+ return result;
 }
 
 #elif defined BOOST_NUMERIC_BINDINGS_BLAS_CUBLAS
@@ -82,9 +86,9 @@
 // * CUBLAS backend, and
 // * complex<float> value-type.
 //
-inline void dotc( const std::ptrdiff_t n, const std::complex<float>* x,
- const std::ptrdiff_t incx, const std::complex<float>* y,
- const std::ptrdiff_t incy ) {
+inline std::complex<float> dotc( const std::ptrdiff_t n,
+ const std::complex<float>* x, const std::ptrdiff_t incx,
+ const std::complex<float>* y, const std::ptrdiff_t incy ) {
     return cublasCdotc( n, x, incx, y, incy );
 }
 
@@ -93,9 +97,9 @@
 // * CUBLAS backend, and
 // * complex<double> value-type.
 //
-inline void dotc( const std::ptrdiff_t n, const std::complex<double>* x,
- const std::ptrdiff_t incx, const std::complex<double>* y,
- const std::ptrdiff_t incy ) {
+inline std::complex<double> dotc( const std::ptrdiff_t n,
+ const std::complex<double>* x, const std::ptrdiff_t incx,
+ const std::complex<double>* y, const std::ptrdiff_t incy ) {
     return // NOT FOUND();
 }
 
@@ -105,9 +109,9 @@
 // * netlib-compatible BLAS backend (the default), and
 // * complex<float> value-type.
 //
-inline void dotc( const std::ptrdiff_t n, const std::complex<float>* x,
- const std::ptrdiff_t incx, const std::complex<float>* y,
- const std::ptrdiff_t incy ) {
+inline std::complex<float> dotc( const std::ptrdiff_t n,
+ const std::complex<float>* x, const std::ptrdiff_t incx,
+ const std::complex<float>* y, const std::ptrdiff_t incy ) {
     return BLAS_CDOTC( &n, x, &incx, y, &incy );
 }
 
@@ -116,9 +120,9 @@
 // * netlib-compatible BLAS backend (the default), and
 // * complex<double> value-type.
 //
-inline void dotc( const std::ptrdiff_t n, const std::complex<double>* x,
- const std::ptrdiff_t incx, const std::complex<double>* y,
- const std::ptrdiff_t incy ) {
+inline std::complex<double> dotc( const std::ptrdiff_t n,
+ const std::complex<double>* x, const std::ptrdiff_t incx,
+ const std::complex<double>* y, const std::ptrdiff_t incy ) {
     return BLAS_ZDOTC( &n, x, &incx, y, &incy );
 }
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dotu.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dotu.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dotu.hpp 2009-12-30 10:31:31 EST (Wed, 30 Dec 2009)
@@ -59,10 +59,12 @@
 // * CBLAS backend, and
 // * complex<float> value-type.
 //
-inline void dotu( const std::ptrdiff_t n, const std::complex<float>* x,
- const std::ptrdiff_t incx, const std::complex<float>* y,
- const std::ptrdiff_t incy ) {
- return cblas_cdotu_sub( n, x, incx, y, incy );
+inline std::complex<float> dotu( const std::ptrdiff_t n,
+ const std::complex<float>* x, const std::ptrdiff_t incx,
+ const std::complex<float>* y, const std::ptrdiff_t incy ) {
+ std::complex<float> result;
+ cblas_cdotu_sub( n, x, incx, y, incy, &result );
+ return result;
 }
 
 //
@@ -70,10 +72,12 @@
 // * CBLAS backend, and
 // * complex<double> value-type.
 //
-inline void dotu( const std::ptrdiff_t n, const std::complex<double>* x,
- const std::ptrdiff_t incx, const std::complex<double>* y,
- const std::ptrdiff_t incy ) {
- return cblas_zdotu_sub( n, x, incx, y, incy );
+inline std::complex<double> dotu( const std::ptrdiff_t n,
+ const std::complex<double>* x, const std::ptrdiff_t incx,
+ const std::complex<double>* y, const std::ptrdiff_t incy ) {
+ std::complex<double> result;
+ cblas_zdotu_sub( n, x, incx, y, incy, &result );
+ return result;
 }
 
 #elif defined BOOST_NUMERIC_BINDINGS_BLAS_CUBLAS
@@ -82,9 +86,9 @@
 // * CUBLAS backend, and
 // * complex<float> value-type.
 //
-inline void dotu( const std::ptrdiff_t n, const std::complex<float>* x,
- const std::ptrdiff_t incx, const std::complex<float>* y,
- const std::ptrdiff_t incy ) {
+inline std::complex<float> dotu( const std::ptrdiff_t n,
+ const std::complex<float>* x, const std::ptrdiff_t incx,
+ const std::complex<float>* y, const std::ptrdiff_t incy ) {
     return cublasCdotu( n, x, incx, y, incy );
 }
 
@@ -93,9 +97,9 @@
 // * CUBLAS backend, and
 // * complex<double> value-type.
 //
-inline void dotu( const std::ptrdiff_t n, const std::complex<double>* x,
- const std::ptrdiff_t incx, const std::complex<double>* y,
- const std::ptrdiff_t incy ) {
+inline std::complex<double> dotu( const std::ptrdiff_t n,
+ const std::complex<double>* x, const std::ptrdiff_t incx,
+ const std::complex<double>* y, const std::ptrdiff_t incy ) {
     return cublasZdotu( n, x, incx, y, incy );
 }
 
@@ -105,9 +109,9 @@
 // * netlib-compatible BLAS backend (the default), and
 // * complex<float> value-type.
 //
-inline void dotu( const std::ptrdiff_t n, const std::complex<float>* x,
- const std::ptrdiff_t incx, const std::complex<float>* y,
- const std::ptrdiff_t incy ) {
+inline std::complex<float> dotu( const std::ptrdiff_t n,
+ const std::complex<float>* x, const std::ptrdiff_t incx,
+ const std::complex<float>* y, const std::ptrdiff_t incy ) {
     return BLAS_CDOTU( &n, x, &incx, y, &incy );
 }
 
@@ -116,9 +120,9 @@
 // * netlib-compatible BLAS backend (the default), and
 // * complex<double> value-type.
 //
-inline void dotu( const std::ptrdiff_t n, const std::complex<double>* x,
- const std::ptrdiff_t incx, const std::complex<double>* y,
- const std::ptrdiff_t incy ) {
+inline std::complex<double> dotu( const std::ptrdiff_t n,
+ const std::complex<double>* x, const std::ptrdiff_t incx,
+ const std::complex<double>* y, const std::ptrdiff_t incy ) {
     return BLAS_ZDOTU( &n, x, &incx, y, &incy );
 }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk