Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59084 - in sandbox/numeric_bindings/libs/numeric/bindings/tools: . templates
From: rutger_at_[hidden]
Date: 2010-01-17 03:05:32


Author: rutger
Date: 2010-01-17 03:05:30 EST (Sun, 17 Jan 2010)
New Revision: 59084
URL: http://svn.boost.org/trac/boost/changeset/59084

Log:
added initial support for routines with more than 4 variants (like, e.g., level1/scal)

Text files modified:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/cblas.py | 2 +-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/cublas.py | 2 +-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/documentation.py | 4 +++-
   sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py | 11 ++++++-----
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/blas_grouping.hpp | 8 ++++++++
   5 files changed, 19 insertions(+), 8 deletions(-)

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/cblas.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/cblas.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/cblas.py 2010-01-17 03:05:30 EST (Sun, 17 Jan 2010)
@@ -50,7 +50,7 @@
             info_map[ fortran_routine ][ prefix + "routine" ] = c_routine
 
             # read aliases, if they are there
- my_key = fortran_routine[ 1: ].lower() + '.all.cblas_alias'
+ my_key = info_map[ fortran_routine ][ 'group_name' ].lower() + '.all.cblas_alias'
             alias_map = {}
             #print my_key
             if netlib.my_has_key( my_key, template_map ) != None:

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/cublas.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/cublas.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/cublas.py 2010-01-17 03:05:30 EST (Sun, 17 Jan 2010)
@@ -41,7 +41,7 @@
             #pp.pprint( info_map[ blas_routine ] )
 
             # read aliases, if they are there
- my_key = blas_routine[ 1: ].lower() + '.all.cblas_alias'
+ my_key = info_map[ blas_routine ][ 'group_name' ].lower() + '.all.cblas_alias'
             alias_map = {}
             print my_key
             if netlib.my_has_key( my_key, template_map ) != None:

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-17 03:05:30 EST (Sun, 17 Jan 2010)
@@ -21,7 +21,9 @@
     { 'complex,single' : 'complex<float>',
       'complex,double' : 'complex<double>',
       'real,single' : 'float',
- 'real,double' : 'double'
+ 'real,double' : 'double',
+ 'complex+real,single' : 'combined float and complex<float>',
+ 'complex+real,double' : 'combined double and complex<double>'
     }
 
 matrix_structure = \

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py 2010-01-17 03:05:30 EST (Sun, 17 Jan 2010)
@@ -777,7 +777,7 @@
 #
 def my_has_key( key_name, template_map ):
   # try, e.g., gelsd.all.
- m_all_key = key_name.replace( ".complex", ".all" ).replace( ".real", ".all" )
+ m_all_key = key_name.replace(".complex+real",".all").replace( ".complex", ".all" ).replace( ".real", ".all" )
   if template_map.has_key( key_name ):
     print "using key ", key_name
     return key_name
@@ -1013,10 +1013,11 @@
       # try to find the original argument with value type
       # it's either from a complex or double variant,
       # not as cleanly applied as we might say
- if subroutine_value_type == 'complex':
- prefixes = [ 'C', 'Z' ]
- else:
- prefixes = [ 'S', 'D' ]
+ prefixes = []
+ if 'complex' in subroutine_value_type:
+ prefixes += [ 'C', 'Z' ]
+ if 'real' in subroutine_value_type:
+ prefixes += [ 'S', 'D' ]
       # determine the original name
       argument_with_value_type = None
       for prefix in prefixes:

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-17 03:05:30 EST (Sun, 17 Jan 2010)
@@ -30,4 +30,12 @@
 complex
 $TEMPLATE[blas.precision.SCNRM2]
 single
+$TEMPLATE[blas.group.ZDSCAL]
+SCAL
+$TEMPLATE[blas.value.ZDSCAL]
+complex+real
+$TEMPLATE[blas.group.CSSCAL]
+SCAL
+$TEMPLATE[blas.value.CSSCAL]
+complex+real
 $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