Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59074 - in sandbox/numeric_bindings/boost/numeric/bindings/blas: detail level1 level3
From: rutger_at_[hidden]
Date: 2010-01-16 10:34:20


Author: rutger
Date: 2010-01-16 10:34:18 EST (Sat, 16 Jan 2010)
New Revision: 59074
URL: http://svn.boost.org/trac/boost/changeset/59074

Log:
fixed ordering bug in typedefs; rotg now has all variants in case of fortran blas backend

Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas.h | 2 +
   sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas_names.h | 2 +
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/rotg.hpp | 64 ++++++++++++++++++++++++++++++++++++++-
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/gemm.hpp | 2
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/her2k.hpp | 2
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/herk.hpp | 2
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/syr2k.hpp | 2
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/syrk.hpp | 2
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/trmm.hpp | 2
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/trsm.hpp | 2
   10 files changed, 73 insertions(+), 9 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 2010-01-16 10:34:18 EST (Sat, 16 Jan 2010)
@@ -93,6 +93,8 @@
 // Value-type variants of rotg
 void BLAS_SROTG( float* a, float* b, float* c, float* s );
 void BLAS_DROTG( double* a, double* b, double* c, double* s );
+void BLAS_CROTG( void* a, void* b, float* c, void* s );
+void BLAS_ZROTG( void* a, void* b, double* c, void* s );
 
 // Value-type variants of rotm
 void BLAS_SROTM( const fortran_int_t* n, float* x, const fortran_int_t* incx,

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas_names.h
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas_names.h (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas_names.h 2010-01-16 10:34:18 EST (Sat, 16 Jan 2010)
@@ -63,6 +63,8 @@
 // Value-type variants of rotg
 #define BLAS_SROTG FORTRAN_ID( srotg )
 #define BLAS_DROTG FORTRAN_ID( drotg )
+#define BLAS_CROTG FORTRAN_ID( crotg )
+#define BLAS_ZROTG FORTRAN_ID( zrotg )
 
 // Value-type variants of rotm
 #define BLAS_SROTM FORTRAN_ID( srotm )

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/rotg.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/rotg.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/rotg.hpp 2010-01-16 10:34:18 EST (Sat, 16 Jan 2010)
@@ -73,6 +73,26 @@
     cblas_drotg( &a, &b, &c, &s );
 }
 
+//
+// Overloaded function for dispatching to
+// * CBLAS backend, and
+// * complex<float> value-type.
+//
+inline void rotg( std::complex<float>& a, std::complex<float>& b, float& c,
+ std::complex<float>& s ) {
+ // NOT FOUND();
+}
+
+//
+// Overloaded function for dispatching to
+// * CBLAS backend, and
+// * complex<double> value-type.
+//
+inline void rotg( std::complex<double>& a, std::complex<double>& b, double& c,
+ std::complex<double>& s ) {
+ // NOT FOUND();
+}
+
 #elif defined BOOST_NUMERIC_BINDINGS_BLAS_CUBLAS
 //
 // Overloaded function for dispatching to
@@ -92,6 +112,26 @@
     cublasDrotg( &a, &b, &c, &s );
 }
 
+//
+// Overloaded function for dispatching to
+// * CUBLAS backend, and
+// * complex<float> value-type.
+//
+inline void rotg( std::complex<float>& a, std::complex<float>& b, float& c,
+ std::complex<float>& s ) {
+ // NOT FOUND();
+}
+
+//
+// Overloaded function for dispatching to
+// * CUBLAS backend, and
+// * complex<double> value-type.
+//
+inline void rotg( std::complex<double>& a, std::complex<double>& b, double& c,
+ std::complex<double>& s ) {
+ // NOT FOUND();
+}
+
 #else
 //
 // Overloaded function for dispatching to
@@ -111,6 +151,26 @@
     BLAS_DROTG( &a, &b, &c, &s );
 }
 
+//
+// Overloaded function for dispatching to
+// * netlib-compatible BLAS backend (the default), and
+// * complex<float> value-type.
+//
+inline void rotg( std::complex<float>& a, std::complex<float>& b, float& c,
+ std::complex<float>& s ) {
+ BLAS_CROTG( &a, &b, &c, &s );
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible BLAS backend (the default), and
+// * complex<double> value-type.
+//
+inline void rotg( std::complex<double>& a, std::complex<double>& b, double& c,
+ std::complex<double>& s ) {
+ BLAS_ZROTG( &a, &b, &c, &s );
+}
+
 #endif
 
 } // namespace detail
@@ -131,8 +191,8 @@
     // * Deduces the required arguments for dispatching to BLAS, and
     // * Asserts that most arguments make sense.
     //
- static return_type invoke( real_type& a, real_type& b, real_type& c,
- real_type& s ) {
+ static return_type invoke( value_type& a, value_type& b, real_type& c,
+ value_type& s ) {
         namespace bindings = ::boost::numeric::bindings;
         detail::rotg( a, b, c, s );
     }

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/gemm.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/gemm.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/gemm.hpp 2010-01-16 10:34:18 EST (Sat, 16 Jan 2010)
@@ -277,9 +277,9 @@
     static return_type invoke( const value_type alpha, const MatrixA& a,
             const MatrixB& b, const value_type beta, MatrixC& c ) {
         namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
         typedef typename result_of::trans_tag< MatrixB, order >::type transb;
         typedef typename result_of::trans_tag< MatrixA, order >::type transa;
- typedef typename result_of::data_order< MatrixC >::type order;
         BOOST_STATIC_ASSERT( (is_same< typename remove_const< typename value<
                 MatrixA >::type >::type, typename remove_const<
                 typename value< MatrixB >::type >::type >::value) );

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/her2k.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/her2k.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/her2k.hpp 2010-01-16 10:34:18 EST (Sat, 16 Jan 2010)
@@ -175,8 +175,8 @@
     static return_type invoke( const value_type alpha, const MatrixA& a,
             const MatrixB& b, const real_type beta, MatrixC& c ) {
         namespace bindings = ::boost::numeric::bindings;
- typedef typename result_of::trans_tag< MatrixA, order >::type trans;
         typedef typename result_of::data_order< MatrixB >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
         typedef typename result_of::uplo_tag< MatrixC >::type uplo;
         BOOST_STATIC_ASSERT( (is_same< typename remove_const< typename value<
                 MatrixA >::type >::type, typename remove_const<

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/herk.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/herk.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/herk.hpp 2010-01-16 10:34:18 EST (Sat, 16 Jan 2010)
@@ -167,8 +167,8 @@
     static return_type invoke( const real_type alpha, const MatrixA& a,
             const real_type beta, MatrixC& c ) {
         namespace bindings = ::boost::numeric::bindings;
- typedef typename result_of::trans_tag< MatrixA, order >::type trans;
         typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
         typedef typename result_of::uplo_tag< MatrixC >::type uplo;
         BOOST_STATIC_ASSERT( (is_same< typename remove_const< typename value<
                 MatrixA >::type >::type, typename remove_const<

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/syr2k.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/syr2k.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/syr2k.hpp 2010-01-16 10:34:18 EST (Sat, 16 Jan 2010)
@@ -267,8 +267,8 @@
     static return_type invoke( const value_type alpha, const MatrixA& a,
             const MatrixB& b, const value_type beta, MatrixC& c ) {
         namespace bindings = ::boost::numeric::bindings;
- typedef typename result_of::trans_tag< MatrixA, order >::type trans;
         typedef typename result_of::data_order< MatrixB >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
         typedef typename result_of::uplo_tag< MatrixC >::type uplo;
         BOOST_STATIC_ASSERT( (is_same< typename remove_const< typename value<
                 MatrixA >::type >::type, typename remove_const<

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/syrk.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/syrk.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/syrk.hpp 2010-01-16 10:34:18 EST (Sat, 16 Jan 2010)
@@ -260,8 +260,8 @@
     static return_type invoke( const value_type alpha, const MatrixA& a,
             const value_type beta, MatrixC& c ) {
         namespace bindings = ::boost::numeric::bindings;
- typedef typename result_of::trans_tag< MatrixA, order >::type trans;
         typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
         typedef typename result_of::uplo_tag< MatrixC >::type uplo;
         BOOST_STATIC_ASSERT( (is_same< typename remove_const< typename value<
                 MatrixA >::type >::type, typename remove_const<

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/trmm.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/trmm.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/trmm.hpp 2010-01-16 10:34:18 EST (Sat, 16 Jan 2010)
@@ -269,8 +269,8 @@
     static return_type invoke( const char side, const value_type alpha,
             const MatrixA& a, MatrixB& b ) {
         namespace bindings = ::boost::numeric::bindings;
- typedef typename result_of::trans_tag< MatrixA, order >::type transa;
         typedef typename result_of::data_order< MatrixB >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type transa;
         typedef typename result_of::uplo_tag< MatrixA, trans >::type uplo;
         typedef typename result_of::diag_tag< MatrixA >::type diag;
         BOOST_STATIC_ASSERT( (is_same< typename remove_const< typename value<

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/trsm.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/trsm.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/trsm.hpp 2010-01-16 10:34:18 EST (Sat, 16 Jan 2010)
@@ -271,8 +271,8 @@
     static return_type invoke( const char side, const value_type alpha,
             const MatrixA& a, MatrixB& b ) {
         namespace bindings = ::boost::numeric::bindings;
- typedef typename result_of::trans_tag< MatrixA, order >::type transa;
         typedef typename result_of::data_order< MatrixB >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type transa;
         typedef typename result_of::uplo_tag< MatrixA, trans >::type uplo;
         typedef typename result_of::diag_tag< MatrixA >::type diag;
         BOOST_STATIC_ASSERT( (is_same< typename remove_const< typename value<


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