|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59051 - in sandbox/numeric_bindings/boost/numeric/bindings/blas: detail level1
From: rutger_at_[hidden]
Date: 2010-01-15 11:13:11
Author: rutger
Date: 2010-01-15 11:13:10 EST (Fri, 15 Jan 2010)
New Revision: 59051
URL: http://svn.boost.org/trac/boost/changeset/59051
Log:
making the grouping of subroutines not dependent on their name, but on value type and precision
Text files modified:
sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas.h | 8 +++---
sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas_names.h | 4 +-
sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/asum.hpp | 50 ++++++++++++++++++++--------------------
sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/nrm2.hpp | 40 ++++++++++++++++----------------
4 files changed, 51 insertions(+), 51 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 11:13:10 EST (Fri, 15 Jan 2010)
@@ -25,12 +25,12 @@
// Value-type variants of asum
float BLAS_SASUM( const fortran_int_t* n, const float* x,
const fortran_int_t* incx );
+double BLAS_DASUM( const fortran_int_t* n, const double* x,
+ const fortran_int_t* incx );
float BLAS_SCASUM( const fortran_int_t* n, const void* x,
const fortran_int_t* incx );
double BLAS_DZASUM( const fortran_int_t* n, const void* x,
const fortran_int_t* incx );
-double BLAS_DASUM( const fortran_int_t* n, const double* x,
- const fortran_int_t* incx );
// Value-type variants of axpy
void BLAS_SAXPY( const fortran_int_t* n, const float* a, const float* x,
@@ -74,10 +74,10 @@
// Value-type variants of nrm2
float BLAS_SNRM2( const fortran_int_t* n, const float* x,
const fortran_int_t* incx );
-float BLAS_SCNRM2( const fortran_int_t* n, const void* x,
- const fortran_int_t* incx );
double BLAS_DNRM2( const fortran_int_t* n, const double* x,
const fortran_int_t* incx );
+float BLAS_SCNRM2( const fortran_int_t* n, const void* x,
+ const fortran_int_t* incx );
double BLAS_DZNRM2( const fortran_int_t* n, const void* 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 11:13:10 EST (Fri, 15 Jan 2010)
@@ -22,9 +22,9 @@
// Value-type variants of asum
#define BLAS_SASUM FORTRAN_ID( sasum )
+#define BLAS_DASUM FORTRAN_ID( dasum )
#define BLAS_SCASUM FORTRAN_ID( scasum )
#define BLAS_DZASUM FORTRAN_ID( dzasum )
-#define BLAS_DASUM FORTRAN_ID( dasum )
// Value-type variants of axpy
#define BLAS_SAXPY FORTRAN_ID( saxpy )
@@ -52,8 +52,8 @@
// Value-type variants of nrm2
#define BLAS_SNRM2 FORTRAN_ID( snrm2 )
-#define BLAS_SCNRM2 FORTRAN_ID( scnrm2 )
#define BLAS_DNRM2 FORTRAN_ID( dnrm2 )
+#define BLAS_SCNRM2 FORTRAN_ID( scnrm2 )
#define BLAS_DZNRM2 FORTRAN_ID( dznrm2 )
// Value-type variants of rot
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 11:13:10 EST (Fri, 15 Jan 2010)
@@ -67,6 +67,15 @@
//
// Overloaded function for dispatching to
// * CBLAS backend, and
+// * double value-type.
+//
+inline double asum( const int n, const double* x, const int incx ) {
+ return cblas_dasum( n, x, incx );
+}
+
+//
+// Overloaded function for dispatching to
+// * CBLAS backend, and
// * float value-type.
//
inline float asum( const int n, const std::complex<float>* x,
@@ -84,23 +93,23 @@
return cblas_dzasum( n, x, incx );
}
+#elif defined BOOST_NUMERIC_BINDINGS_BLAS_CUBLAS
//
// Overloaded function for dispatching to
-// * CBLAS backend, and
-// * double value-type.
+// * CUBLAS backend, and
+// * float value-type.
//
-inline double asum( const int n, const double* x, const int incx ) {
- return cblas_dasum( n, x, incx );
+inline float asum( const int n, const float* x, const int incx ) {
+ return cublasSasum( n, x, incx );
}
-#elif defined BOOST_NUMERIC_BINDINGS_BLAS_CUBLAS
//
// Overloaded function for dispatching to
// * CUBLAS backend, and
-// * float value-type.
+// * double value-type.
//
-inline float asum( const int n, const float* x, const int incx ) {
- return cublasSasum( n, x, incx );
+inline double asum( const int n, const double* x, const int incx ) {
+ return cublasDasum( n, x, incx );
}
//
@@ -123,15 +132,6 @@
return // NOT FOUND();
}
-//
-// Overloaded function for dispatching to
-// * CUBLAS backend, and
-// * double value-type.
-//
-inline double asum( const int n, const double* x, const int incx ) {
- return cublasDasum( n, x, incx );
-}
-
#else
//
// Overloaded function for dispatching to
@@ -146,21 +146,21 @@
//
// Overloaded function for dispatching to
// * netlib-compatible BLAS backend (the default), and
-// * float value-type.
+// * double value-type.
//
-inline float asum( const fortran_int_t n, const std::complex<float>* x,
+inline double asum( const fortran_int_t n, const double* x,
const fortran_int_t incx ) {
- return BLAS_SCASUM( &n, x, &incx );
+ return BLAS_DASUM( &n, x, &incx );
}
//
// Overloaded function for dispatching to
// * netlib-compatible BLAS backend (the default), and
-// * double value-type.
+// * float value-type.
//
-inline double asum( const fortran_int_t n, const std::complex<double>* x,
+inline float asum( const fortran_int_t n, const std::complex<float>* x,
const fortran_int_t incx ) {
- return BLAS_DZASUM( &n, x, &incx );
+ return BLAS_SCASUM( &n, x, &incx );
}
//
@@ -168,9 +168,9 @@
// * netlib-compatible BLAS backend (the default), and
// * double value-type.
//
-inline double asum( const fortran_int_t n, const double* x,
+inline double asum( const fortran_int_t n, const std::complex<double>* x,
const fortran_int_t incx ) {
- return BLAS_DASUM( &n, x, &incx );
+ return BLAS_DZASUM( &n, x, &incx );
}
#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 11:13:10 EST (Fri, 15 Jan 2010)
@@ -67,20 +67,20 @@
//
// Overloaded function for dispatching to
// * CBLAS backend, and
-// * float value-type.
+// * double value-type.
//
-inline float nrm2( const int n, const std::complex<float>* x,
- const int incx ) {
- return cblas_scnrm2( n, x, incx );
+inline double nrm2( const int n, const double* x, const int incx ) {
+ return cblas_dnrm2( n, x, incx );
}
//
// Overloaded function for dispatching to
// * CBLAS backend, and
-// * double value-type.
+// * float value-type.
//
-inline double nrm2( const int n, const double* x, const int incx ) {
- return cblas_dnrm2( n, x, incx );
+inline float nrm2( const int n, const std::complex<float>* x,
+ const int incx ) {
+ return cblas_scnrm2( n, x, incx );
}
//
@@ -106,20 +106,20 @@
//
// Overloaded function for dispatching to
// * CUBLAS backend, and
-// * float value-type.
+// * double value-type.
//
-inline float nrm2( const int n, const std::complex<float>* x,
- const int incx ) {
- return cublasScnrm2( n, x, incx );
+inline double nrm2( const int n, const double* x, const int incx ) {
+ return cublasDnrm2( n, x, incx );
}
//
// Overloaded function for dispatching to
// * CUBLAS backend, and
-// * double value-type.
+// * float value-type.
//
-inline double nrm2( const int n, const double* x, const int incx ) {
- return cublasDnrm2( n, x, incx );
+inline float nrm2( const int n, const std::complex<float>* x,
+ const int incx ) {
+ return cublasScnrm2( n, x, incx );
}
//
@@ -146,21 +146,21 @@
//
// Overloaded function for dispatching to
// * netlib-compatible BLAS backend (the default), and
-// * float value-type.
+// * double value-type.
//
-inline float nrm2( const fortran_int_t n, const std::complex<float>* x,
+inline double nrm2( const fortran_int_t n, const double* x,
const fortran_int_t incx ) {
- return BLAS_SCNRM2( &n, x, &incx );
+ return BLAS_DNRM2( &n, x, &incx );
}
//
// Overloaded function for dispatching to
// * netlib-compatible BLAS backend (the default), and
-// * double value-type.
+// * float value-type.
//
-inline double nrm2( const fortran_int_t n, const double* x,
+inline float nrm2( const fortran_int_t n, const std::complex<float>* x,
const fortran_int_t incx ) {
- return BLAS_DNRM2( &n, x, &incx );
+ return BLAS_SCNRM2( &n, x, &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