|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59120 - in sandbox/numeric_bindings/boost/numeric/bindings/blas: . detail level1
From: rutger_at_[hidden]
Date: 2010-01-18 04:55:44
Author: rutger
Date: 2010-01-18 04:55:42 EST (Mon, 18 Jan 2010)
New Revision: 59120
URL: http://svn.boost.org/trac/boost/changeset/59120
Log:
added support for level1/prec_dot
Added:
sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/prec_dot.hpp (contents, props changed)
Removed:
sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/sdot.hpp
Text files modified:
sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas.h | 9 ++++-----
sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/blas_names.h | 6 +++---
sandbox/numeric_bindings/boost/numeric/bindings/blas/level1.hpp | 2 +-
3 files changed, 8 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-18 04:55:42 EST (Mon, 18 Jan 2010)
@@ -89,6 +89,10 @@
double BLAS_DZNRM2( const fortran_int_t* n, const void* x,
const fortran_int_t* incx );
+// Value-type variants of prec_dot
+double BLAS_DSDOT( const fortran_int_t* n, const float* x,
+ const fortran_int_t* incx, const float* y, const fortran_int_t* incy );
+
// Value-type variants of rot
void BLAS_SROT( const fortran_int_t* n, float* x, const fortran_int_t* incx,
float* y, const fortran_int_t* incy, const float* c, const float* s );
@@ -132,11 +136,6 @@
void BLAS_ZSCAL( const fortran_int_t* n, const void* a, void* x,
const fortran_int_t* incx );
-// Value-type variants of sdot
-double BLAS_DSDOT( const fortran_int_t* n, const float* sx,
- const fortran_int_t* incx, const float* sy,
- const fortran_int_t* incy );
-
// Value-type variants of swap
void BLAS_SSWAP( const fortran_int_t* n, float* x, const fortran_int_t* incx,
float* y, const fortran_int_t* incy );
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-18 04:55:42 EST (Mon, 18 Jan 2010)
@@ -60,6 +60,9 @@
#define BLAS_SCNRM2 FORTRAN_ID( scnrm2 )
#define BLAS_DZNRM2 FORTRAN_ID( dznrm2 )
+// Value-type variants of prec_dot
+#define BLAS_DSDOT FORTRAN_ID( dsdot )
+
// Value-type variants of rot
#define BLAS_SROT FORTRAN_ID( srot )
#define BLAS_DROT FORTRAN_ID( drot )
@@ -88,9 +91,6 @@
#define BLAS_CSCAL FORTRAN_ID( cscal )
#define BLAS_ZSCAL FORTRAN_ID( zscal )
-// Value-type variants of sdot
-#define BLAS_DSDOT FORTRAN_ID( dsdot )
-
// Value-type variants of swap
#define BLAS_SSWAP FORTRAN_ID( sswap )
#define BLAS_DSWAP FORTRAN_ID( dswap )
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-18 04:55:42 EST (Mon, 18 Jan 2010)
@@ -17,12 +17,12 @@
#include <boost/numeric/bindings/blas/level1/dotu.hpp>
#include <boost/numeric/bindings/blas/level1/iamax.hpp>
#include <boost/numeric/bindings/blas/level1/nrm2.hpp>
+#include <boost/numeric/bindings/blas/level1/prec_dot.hpp>
#include <boost/numeric/bindings/blas/level1/rotg.hpp>
#include <boost/numeric/bindings/blas/level1/rot.hpp>
#include <boost/numeric/bindings/blas/level1/rotmg.hpp>
#include <boost/numeric/bindings/blas/level1/rotm.hpp>
#include <boost/numeric/bindings/blas/level1/scal.hpp>
-#include <boost/numeric/bindings/blas/level1/sdot.hpp>
#include <boost/numeric/bindings/blas/level1/set.hpp>
#include <boost/numeric/bindings/blas/level1/swap.hpp>
Added: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/prec_dot.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/prec_dot.hpp 2010-01-18 04:55:42 EST (Mon, 18 Jan 2010)
@@ -0,0 +1,147 @@
+//
+// 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_PREC_DOT_HPP
+#define BOOST_NUMERIC_BINDINGS_BLAS_LEVEL1_PREC_DOT_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_type.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
+// * double value-type.
+//
+inline double prec_dot( const int n, const float* x, const int incx,
+ const float* y, const int incy ) {
+ return cblas_dsdot( n, x, incx, y, incy );
+}
+
+#elif defined BOOST_NUMERIC_BINDINGS_BLAS_CUBLAS
+//
+// Overloaded function for dispatching to
+// * CUBLAS backend, and
+// * double value-type.
+//
+inline double prec_dot( const int n, const float* x, const int incx,
+ const float* y, const int incy ) {
+ return // NOT FOUND();
+}
+
+#else
+//
+// Overloaded function for dispatching to
+// * netlib-compatible BLAS backend (the default), and
+// * double value-type.
+//
+inline double prec_dot( const fortran_int_t n, const float* x,
+ const fortran_int_t incx, const float* y, const fortran_int_t incy ) {
+ return BLAS_DSDOT( &n, x, &incx, y, &incy );
+}
+
+#endif
+
+} // namespace detail
+
+//
+// Value-type based template class. Use this class if you need a type
+// for dispatching to prec_dot.
+//
+template< typename Value >
+struct prec_dot_impl {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+ typedef double 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 bindings::value_type< VectorX >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorY >::type >::type >::value) );
+ return detail::prec_dot( 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 prec_dot_impl classes. In the
+// documentation, the const-overloads are collapsed to avoid a large number of
+// prototypes which are very similar.
+//
+
+//
+// Overloaded function for prec_dot. Its overload differs for
+//
+template< typename VectorX, typename VectorY >
+inline typename prec_dot_impl< typename bindings::value_type<
+ VectorX >::type >::return_type
+prec_dot( const VectorX& x, const VectorY& y ) {
+ return prec_dot_impl< typename bindings::value_type<
+ VectorX >::type >::invoke( x, y );
+}
+
+} // namespace blas
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif
Deleted: sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/sdot.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level1/sdot.hpp 2010-01-18 04:55:42 EST (Mon, 18 Jan 2010)
+++ (empty file)
@@ -1,150 +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_SDOT_HPP
-#define BOOST_NUMERIC_BINDINGS_BLAS_LEVEL1_SDOT_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_type.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
-// * double value-type.
-//
-inline double sdot( const int n, const float* sx, const int incx,
- const float* sy, const int incy ) {
- return cblas_dsdot( n, sx, incx, sy, incy );
-}
-
-#elif defined BOOST_NUMERIC_BINDINGS_BLAS_CUBLAS
-//
-// Overloaded function for dispatching to
-// * CUBLAS backend, and
-// * double value-type.
-//
-inline double sdot( const int n, const float* sx, const int incx,
- const float* sy, const int incy ) {
- return // NOT FOUND();
-}
-
-#else
-//
-// Overloaded function for dispatching to
-// * netlib-compatible BLAS backend (the default), and
-// * double value-type.
-//
-inline double sdot( const fortran_int_t n, const float* sx,
- const fortran_int_t incx, const float* sy, const fortran_int_t incy ) {
- return BLAS_DSDOT( &n, sx, &incx, sy, &incy );
-}
-
-#endif
-
-} // namespace detail
-
-//
-// Value-type based template class. Use this class if you need a type
-// for dispatching to sdot.
-//
-template< typename Value >
-struct sdot_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 VectorSX, typename VectorSY >
- static return_type invoke( const std::ptrdiff_t n, const VectorSX& sx,
- const std::ptrdiff_t incx, const VectorSY& sy,
- const std::ptrdiff_t incy ) {
- namespace bindings = ::boost::numeric::bindings;
- BOOST_STATIC_ASSERT( (is_same< typename remove_const<
- typename bindings::value_type< VectorSX >::type >::type,
- typename remove_const< typename bindings::value_type<
- VectorSY >::type >::type >::value) );
- return detail::sdot( n, bindings::begin_value(sx), incx,
- bindings::begin_value(sy), incy );
- }
-};
-
-//
-// 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 sdot_impl classes. In the
-// documentation, the const-overloads are collapsed to avoid a large number of
-// prototypes which are very similar.
-//
-
-//
-// Overloaded function for sdot. Its overload differs for
-//
-template< typename VectorSX, typename VectorSY >
-inline typename sdot_impl< typename bindings::value_type<
- VectorSX >::type >::return_type
-sdot( const std::ptrdiff_t n, const VectorSX& sx,
- const std::ptrdiff_t incx, const VectorSY& sy,
- const std::ptrdiff_t incy ) {
- return sdot_impl< typename bindings::value_type<
- VectorSX >::type >::invoke( n, sx, incx, sy, incy );
-}
-
-} // namespace blas
-} // namespace bindings
-} // namespace numeric
-} // namespace boost
-
-#endif
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