Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59057 - in sandbox/numeric_bindings/boost/numeric/bindings/blas: . detail level1
From: rutger_at_[hidden]
Date: 2010-01-15 16:31:35


Author: rutger
Date: 2010-01-15 16:31:33 EST (Fri, 15 Jan 2010)
New Revision: 59057
URL: http://svn.boost.org/trac/boost/changeset/59057

Log:
merged blas dotu into blas dot; asum/nrm2 commented value-types are corrected

Removed:
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dotu.hpp
Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas.h | 10 ++---
   sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas_names.h | 6 +--
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level1.hpp | 1
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/asum.hpp | 12 +++---
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dot.hpp | 66 ++++++++++++++++++++++++++++++++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/nrm2.hpp | 12 +++---
   6 files changed, 84 insertions(+), 23 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-15 16:31:33 EST (Fri, 15 Jan 2010)
@@ -58,6 +58,10 @@
 double BLAS_DDOT( const fortran_int_t* n, const double* x,
         const fortran_int_t* incx, const double* y,
         const fortran_int_t* incy );
+std::complex<float> BLAS_CDOTU( const fortran_int_t* n, const void* x,
+ const fortran_int_t* incx, const void* y, const fortran_int_t* incy );
+std::complex<double> BLAS_ZDOTU( const fortran_int_t* n, const void* x,
+ const fortran_int_t* incx, const void* y, const fortran_int_t* incy );
 
 // Value-type variants of dotc
 std::complex<float> BLAS_CDOTC( const fortran_int_t* n, const void* x,
@@ -65,12 +69,6 @@
 std::complex<double> BLAS_ZDOTC( const fortran_int_t* n, const void* x,
         const fortran_int_t* incx, const void* y, const fortran_int_t* incy );
 
-// Value-type variants of dotu
-std::complex<float> BLAS_CDOTU( const fortran_int_t* n, const void* x,
- const fortran_int_t* incx, const void* y, const fortran_int_t* incy );
-std::complex<double> BLAS_ZDOTU( const fortran_int_t* n, const void* x,
- const fortran_int_t* incx, const void* y, const fortran_int_t* incy );
-
 // Value-type variants of nrm2
 float BLAS_SNRM2( const fortran_int_t* n, const 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-15 16:31:33 EST (Fri, 15 Jan 2010)
@@ -41,15 +41,13 @@
 // Value-type variants of dot
 #define BLAS_SDOT FORTRAN_ID( sdot )
 #define BLAS_DDOT FORTRAN_ID( ddot )
+#define BLAS_CDOTU FORTRAN_ID( cdotu )
+#define BLAS_ZDOTU FORTRAN_ID( zdotu )
 
 // Value-type variants of dotc
 #define BLAS_CDOTC FORTRAN_ID( cdotc )
 #define BLAS_ZDOTC FORTRAN_ID( zdotc )
 
-// Value-type variants of dotu
-#define BLAS_CDOTU FORTRAN_ID( cdotu )
-#define BLAS_ZDOTU FORTRAN_ID( zdotu )
-
 // Value-type variants of nrm2
 #define BLAS_SNRM2 FORTRAN_ID( snrm2 )
 #define BLAS_DNRM2 FORTRAN_ID( dnrm2 )

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level1.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level1.hpp 2010-01-15 16:31:33 EST (Fri, 15 Jan 2010)
@@ -14,7 +14,6 @@
 #include <boost/numeric/bindings/blas/level1/copy.hpp>
 #include <boost/numeric/bindings/blas/level1/dotc.hpp>
 #include <boost/numeric/bindings/blas/level1/dot.hpp>
-#include <boost/numeric/bindings/blas/level1/dotu.hpp>
 #include <boost/numeric/bindings/blas/level1/drot.hpp>
 #include <boost/numeric/bindings/blas/level1/nrm2.hpp>
 #include <boost/numeric/bindings/blas/level1/rotg.hpp>

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/asum.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/asum.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/asum.hpp 2010-01-15 16:31:33 EST (Fri, 15 Jan 2010)
@@ -76,7 +76,7 @@
 //
 // Overloaded function for dispatching to
 // * CBLAS backend, and
-// * float value-type.
+// * complex<float> value-type.
 //
 inline float asum( const int n, const std::complex<float>* x,
         const int incx ) {
@@ -86,7 +86,7 @@
 //
 // Overloaded function for dispatching to
 // * CBLAS backend, and
-// * double value-type.
+// * complex<double> value-type.
 //
 inline double asum( const int n, const std::complex<double>* x,
         const int incx ) {
@@ -115,7 +115,7 @@
 //
 // Overloaded function for dispatching to
 // * CUBLAS backend, and
-// * float value-type.
+// * complex<float> value-type.
 //
 inline float asum( const int n, const std::complex<float>* x,
         const int incx ) {
@@ -125,7 +125,7 @@
 //
 // Overloaded function for dispatching to
 // * CUBLAS backend, and
-// * double value-type.
+// * complex<double> value-type.
 //
 inline double asum( const int n, const std::complex<double>* x,
         const int incx ) {
@@ -156,7 +156,7 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible BLAS backend (the default), and
-// * float value-type.
+// * complex<float> value-type.
 //
 inline float asum( const fortran_int_t n, const std::complex<float>* x,
         const fortran_int_t incx ) {
@@ -166,7 +166,7 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible BLAS backend (the default), and
-// * double value-type.
+// * complex<double> value-type.
 //
 inline double asum( const fortran_int_t n, const std::complex<double>* x,
         const fortran_int_t incx ) {

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dot.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dot.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dot.hpp 2010-01-15 16:31:33 EST (Fri, 15 Jan 2010)
@@ -75,6 +75,30 @@
     return cblas_ddot( n, x, incx, y, incy );
 }
 
+//
+// Overloaded function for dispatching to
+// * CBLAS backend, and
+// * complex<float> value-type.
+//
+inline std::complex<float> dot( const int n, const std::complex<float>* x,
+ const int incx, const std::complex<float>* y, const int incy ) {
+ std::complex<float> result;
+ cblas_cdotu_sub( n, x, incx, y, incy, &result );
+ return result;
+}
+
+//
+// Overloaded function for dispatching to
+// * CBLAS backend, and
+// * complex<double> value-type.
+//
+inline std::complex<double> dot( const int n, const std::complex<double>* x,
+ const int incx, const std::complex<double>* y, const int incy ) {
+ std::complex<double> result;
+ cblas_zdotu_sub( n, x, incx, y, incy, &result );
+ return result;
+}
+
 #elif defined BOOST_NUMERIC_BINDINGS_BLAS_CUBLAS
 //
 // Overloaded function for dispatching to
@@ -96,6 +120,26 @@
     return cublasDdot( n, x, incx, y, incy );
 }
 
+//
+// Overloaded function for dispatching to
+// * CUBLAS backend, and
+// * complex<float> value-type.
+//
+inline std::complex<float> dot( const int n, const std::complex<float>* x,
+ const int incx, const std::complex<float>* y, const int incy ) {
+ return cublasCdotu( n, x, incx, y, incy );
+}
+
+//
+// Overloaded function for dispatching to
+// * CUBLAS backend, and
+// * complex<double> value-type.
+//
+inline std::complex<double> dot( const int n, const std::complex<double>* x,
+ const int incx, const std::complex<double>* y, const int incy ) {
+ return cublasZdotu( n, x, incx, y, incy );
+}
+
 #else
 //
 // Overloaded function for dispatching to
@@ -117,6 +161,28 @@
     return BLAS_DDOT( &n, x, &incx, y, &incy );
 }
 
+//
+// Overloaded function for dispatching to
+// * netlib-compatible BLAS backend (the default), and
+// * complex<float> value-type.
+//
+inline std::complex<float> dot( const fortran_int_t n,
+ const std::complex<float>* x, const fortran_int_t incx,
+ const std::complex<float>* y, const fortran_int_t incy ) {
+ return BLAS_CDOTU( &n, x, &incx, y, &incy );
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible BLAS backend (the default), and
+// * complex<double> value-type.
+//
+inline std::complex<double> dot( const fortran_int_t n,
+ const std::complex<double>* x, const fortran_int_t incx,
+ const std::complex<double>* y, const fortran_int_t incy ) {
+ return BLAS_ZDOTU( &n, x, &incx, y, &incy );
+}
+
 #endif
 
 } // namespace detail

Deleted: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dotu.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/dotu.hpp 2010-01-15 16:31:33 EST (Fri, 15 Jan 2010)
+++ (empty file)
@@ -1,180 +0,0 @@
-//
-// Copyright (c) 2002--2010
-// Toon Knapen, Karl Meerbergen, Kresimir Fresl,
-// Thomas Klimpel and Rutger ter Borg
-//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-//
-// THIS FILE IS AUTOMATICALLY GENERATED
-// PLEASE DO NOT EDIT!
-//
-
-#ifndef BOOST_NUMERIC_BINDINGS_BLAS_LEVEL1_DOTU_HPP
-#define BOOST_NUMERIC_BINDINGS_BLAS_LEVEL1_DOTU_HPP
-
-#include <boost/assert.hpp>
-#include <boost/numeric/bindings/begin.hpp>
-#include <boost/numeric/bindings/is_mutable.hpp>
-#include <boost/numeric/bindings/remove_imaginary.hpp>
-#include <boost/numeric/bindings/size.hpp>
-#include <boost/numeric/bindings/stride.hpp>
-#include <boost/numeric/bindings/value.hpp>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/remove_const.hpp>
-
-//
-// The BLAS-backend is selected by defining a pre-processor variable,
-// which can be one of
-// * for CBLAS, define BOOST_NUMERIC_BINDINGS_BLAS_CBLAS
-// * for CUBLAS, define BOOST_NUMERIC_BINDINGS_BLAS_CUBLAS
-// * netlib-compatible BLAS is the default
-//
-#if defined BOOST_NUMERIC_BINDINGS_BLAS_CBLAS
-#include <boost/numeric/bindings/blas/detail/cblas.h>
-#include <boost/numeric/bindings/blas/detail/cblas_option.hpp>
-#elif defined BOOST_NUMERIC_BINDINGS_BLAS_CUBLAS
-#include <boost/numeric/bindings/blas/detail/cublas.h>
-#include <boost/numeric/bindings/blas/detail/blas_option.hpp>
-#else
-#include <boost/numeric/bindings/blas/detail/blas.h>
-#include <boost/numeric/bindings/blas/detail/blas_option.hpp>
-#endif
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-namespace blas {
-
-//
-// The detail namespace contains value-type-overloaded functions that
-// dispatch to the appropriate back-end BLAS-routine.
-//
-namespace detail {
-
-#if defined BOOST_NUMERIC_BINDINGS_BLAS_CBLAS
-//
-// Overloaded function for dispatching to
-// * CBLAS backend, and
-// * complex<float> value-type.
-//
-inline std::complex<float> dotu( const int n, const std::complex<float>* x,
- const int incx, const std::complex<float>* y, const int incy ) {
- std::complex<float> result;
- cblas_cdotu_sub( n, x, incx, y, incy, &result );
- return result;
-}
-
-//
-// Overloaded function for dispatching to
-// * CBLAS backend, and
-// * complex<double> value-type.
-//
-inline std::complex<double> dotu( const int n, const std::complex<double>* x,
- const int incx, const std::complex<double>* y, const int incy ) {
- std::complex<double> result;
- cblas_zdotu_sub( n, x, incx, y, incy, &result );
- return result;
-}
-
-#elif defined BOOST_NUMERIC_BINDINGS_BLAS_CUBLAS
-//
-// Overloaded function for dispatching to
-// * CUBLAS backend, and
-// * complex<float> value-type.
-//
-inline std::complex<float> dotu( const int n, const std::complex<float>* x,
- const int incx, const std::complex<float>* y, const int incy ) {
- return cublasCdotu( n, x, incx, y, incy );
-}
-
-//
-// Overloaded function for dispatching to
-// * CUBLAS backend, and
-// * complex<double> value-type.
-//
-inline std::complex<double> dotu( const int n, const std::complex<double>* x,
- const int incx, const std::complex<double>* y, const int incy ) {
- return cublasZdotu( n, x, incx, y, incy );
-}
-
-#else
-//
-// Overloaded function for dispatching to
-// * netlib-compatible BLAS backend (the default), and
-// * complex<float> value-type.
-//
-inline std::complex<float> dotu( const fortran_int_t n,
- const std::complex<float>* x, const fortran_int_t incx,
- const std::complex<float>* y, const fortran_int_t incy ) {
- return BLAS_CDOTU( &n, x, &incx, y, &incy );
-}
-
-//
-// Overloaded function for dispatching to
-// * netlib-compatible BLAS backend (the default), and
-// * complex<double> value-type.
-//
-inline std::complex<double> dotu( const fortran_int_t n,
- const std::complex<double>* x, const fortran_int_t incx,
- const std::complex<double>* y, const fortran_int_t incy ) {
- return BLAS_ZDOTU( &n, x, &incx, y, &incy );
-}
-
-#endif
-
-} // namespace detail
-
-//
-// Value-type based template class. Use this class if you need a type
-// for dispatching to dotu.
-//
-template< typename Value >
-struct dotu_impl {
-
- typedef Value value_type;
- typedef typename remove_imaginary< Value >::type real_type;
- typedef value_type return_type;
-
- //
- // Static member function that
- // * Deduces the required arguments for dispatching to BLAS, and
- // * Asserts that most arguments make sense.
- //
- template< typename VectorX, typename VectorY >
- static return_type invoke( const VectorX& x, const VectorY& y ) {
- namespace bindings = ::boost::numeric::bindings;
- BOOST_STATIC_ASSERT( (is_same< typename remove_const< typename value<
- VectorX >::type >::type, typename remove_const<
- typename value< VectorY >::type >::type >::value) );
- return detail::dotu( bindings::size(x),
- bindings::begin_value(x), bindings::stride(x),
- bindings::begin_value(y), bindings::stride(y) );
- }
-};
-
-//
-// Functions for direct use. These functions are overloaded for temporaries,
-// so that wrapped types can still be passed and used for write-access. Calls
-// to these functions are passed to the dotu_impl classes. In the
-// documentation, the const-overloads are collapsed to avoid a large number of
-// prototypes which are very similar.
-//
-
-//
-// Overloaded function for dotu. Its overload differs for
-//
-template< typename VectorX, typename VectorY >
-inline typename dotu_impl< typename value< VectorX >::type >::return_type
-dotu( const VectorX& x, const VectorY& y ) {
- return dotu_impl< typename value< VectorX >::type >::invoke( x, y );
-}
-
-} // namespace blas
-} // namespace bindings
-} // namespace numeric
-} // namespace boost
-
-#endif

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/nrm2.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/nrm2.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/nrm2.hpp 2010-01-15 16:31:33 EST (Fri, 15 Jan 2010)
@@ -76,7 +76,7 @@
 //
 // Overloaded function for dispatching to
 // * CBLAS backend, and
-// * float value-type.
+// * complex<float> value-type.
 //
 inline float nrm2( const int n, const std::complex<float>* x,
         const int incx ) {
@@ -86,7 +86,7 @@
 //
 // Overloaded function for dispatching to
 // * CBLAS backend, and
-// * double value-type.
+// * complex<double> value-type.
 //
 inline double nrm2( const int n, const std::complex<double>* x,
         const int incx ) {
@@ -115,7 +115,7 @@
 //
 // Overloaded function for dispatching to
 // * CUBLAS backend, and
-// * float value-type.
+// * complex<float> value-type.
 //
 inline float nrm2( const int n, const std::complex<float>* x,
         const int incx ) {
@@ -125,7 +125,7 @@
 //
 // Overloaded function for dispatching to
 // * CUBLAS backend, and
-// * double value-type.
+// * complex<double> value-type.
 //
 inline double nrm2( const int n, const std::complex<double>* x,
         const int incx ) {
@@ -156,7 +156,7 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible BLAS backend (the default), and
-// * float value-type.
+// * complex<float> value-type.
 //
 inline float nrm2( const fortran_int_t n, const std::complex<float>* x,
         const fortran_int_t incx ) {
@@ -166,7 +166,7 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible BLAS backend (the default), and
-// * double value-type.
+// * complex<double> value-type.
 //
 inline double nrm2( const fortran_int_t n, const std::complex<double>* x,
         const fortran_int_t incx ) {


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