Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59058 - in sandbox/numeric_bindings/libs/numeric/bindings/tools: . templates templates/level1
From: rutger_at_[hidden]
Date: 2010-01-15 16:32:34


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

Log:
improvements in generalization of grouping of algorithms, merged dotu into dot

Removed:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dotu.hpp
Text files modified:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py | 9 ++++++++-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/documentation.py | 7 +++++++
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas_grouping.hpp | 4 ++++
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dot.hpp | 6 ++++++
   4 files changed, 25 insertions(+), 1 deletions(-)

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/blas_generator.py 2010-01-15 16:32:33 EST (Fri, 15 Jan 2010)
@@ -77,6 +77,13 @@
     for select_backend in [ 'blas_overloads', 'cblas_overloads', 'cublas_overloads' ]:
       sub_overloads = ''
       for subroutine in subroutines:
+
+ # stuff like float, complex<double>, etc.
+ subroutine_value_type = documentation. \
+ subroutine_value_type[ ",".join( [
+ info_map[ subroutine ][ 'value_type' ],
+ info_map[ subroutine ][ 'precision' ] ] ) ]
+
         sub_template = template_map[ select_backend ]
         # add the argument list here
         arg_list = []
@@ -109,7 +116,7 @@
         sub_template = sub_template.replace( "$CALL_BLAS_HEADER", ", ".join( blas_arg_list ) )
         sub_template = sub_template.replace( "$CALL_CBLAS_HEADER", ", ".join( cblas_arg_list ) )
         sub_template = sub_template.replace( "$SUBROUTINE", subroutine )
- sub_template = sub_template.replace( "$SPECIALIZATION", documentation.routine_value_type[ subroutine[0] ] )
+ sub_template = sub_template.replace( "$SPECIALIZATION", subroutine_value_type )
         sub_template = sub_template.replace( '$STATIC_ASSERTS', "\n ".join( level0_static_asserts ) )
 
         if select_backend == 'blas_overloads':

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/documentation.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/documentation.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/documentation.py 2010-01-15 16:32:33 EST (Fri, 15 Jan 2010)
@@ -17,6 +17,13 @@
       'D' : 'double',
       'S' : 'float' }
 
+subroutine_value_type = \
+ { 'complex,single' : 'complex<float>',
+ 'complex,double' : 'complex<double>',
+ 'real,single' : 'float',
+ 'real,double' : 'double'
+ }
+
 matrix_structure = \
     { 'G' : 'generic',
       'H' : 'hermitian',

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas_grouping.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas_grouping.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas_grouping.hpp 2010-01-15 16:32:33 EST (Fri, 15 Jan 2010)
@@ -1,3 +1,7 @@
+$TEMPLATE[blas.group.CDOTU]
+DOT
+$TEMPLATE[blas.group.ZDOTU]
+DOT
 $TEMPLATE[blas.group.DZASUM]
 ASUM
 $TEMPLATE[blas.value.DZASUM]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dot.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dot.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dot.hpp 2010-01-15 16:32:33 EST (Fri, 15 Jan 2010)
@@ -9,4 +9,10 @@
            The increment of Y
  X (input) DATATYPE array of length (N)
  Y (input) DATATYPE array of length (N)
+$TEMPLATE[dot.level0.gsub]
+return cblas_cdotu_sub( n, x, incx, y, incy );->std::complex<float> result;
+ cblas_cdotu_sub( n, x, incx, y, incy, &result );
+ return result;--return cblas_zdotu_sub( n, x, incx, y, incy );->std::complex<double> result;
+ cblas_zdotu_sub( n, x, incx, y, incy, &result );
+ return result;--
 $TEMPLATE[end]

Deleted: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dotu.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level1/dotu.hpp 2010-01-15 16:32:33 EST (Fri, 15 Jan 2010)
+++ (empty file)
@@ -1,20 +0,0 @@
-$TEMPLATE[dotu.all.remove_argument_value_type_prepend]
-X,Y
-$TEMPLATE[dotu.all.arguments]
- N (input) INTEGER
- The length of array X
- INCX (input) INTEGER
- The increment of X
- INCY (input) INTEGER
- The increment of Y
- X (input) DATATYPE
- Y (input) DATATYPE
-$TEMPLATE[dotu.friendly_name]
-TODO
-$TEMPLATE[dotu.level0.gsub]
-return cblas_cdotu_sub( n, x, incx, y, incy );->std::complex<float> result;
- cblas_cdotu_sub( n, x, incx, y, incy, &result );
- return result;--return cblas_zdotu_sub( n, x, incx, y, incy );->std::complex<double> result;
- cblas_zdotu_sub( n, x, incx, y, incy, &result );
- return result;--
-$TEMPLATE[end]


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