Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58893 - in sandbox/numeric_bindings/libs/numeric/bindings/tools: . templates
From: rutger_at_[hidden]
Date: 2010-01-11 06:28:55


Author: rutger
Date: 2010-01-11 06:28:54 EST (Mon, 11 Jan 2010)
New Revision: 58893
URL: http://svn.boost.org/trac/boost/changeset/58893

Log:
added support for ATLAS's CLAPACK backend implementation in LAPACK

Text files modified:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/cblas.py | 60 +++++++++++++-------
   sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py | 113 ++++++++++++++++++++++++++++++---------
   sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py | 9 +++
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/lapack.hpp | 87 ++++++++++++++++++++++--------
   4 files changed, 197 insertions(+), 72 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-11 06:28:54 EST (Mon, 11 Jan 2010)
@@ -18,14 +18,23 @@
 
 def parse_file( filename, info_map, template_map ):
 
+ parser_mode = template_map[ 'PARSERMODE' ]
+ prefix_map = { 'BLAS': 'cblas_',
+ 'LAPACK': 'clapack_' }
+ prefix = prefix_map[ parser_mode ]
+
+ print prefix
+
     pp = pprint.PrettyPrinter( indent = 2 )
     source = open( filename ).read()
 
- for match in re.compile( '(void|float|double) +cblas_([^\(]+)\(([^\)]+)\)', re.M | re.S ).findall( source ):
+ for match in re.compile( '(void|float|int|double) +' + prefix + '([^\(]+)\(([^\)]+)\)', re.M | re.S ).findall( source ):
         print "----"
         return_type = match[0]
- blas_routine = match[1].split("_sub")[0].upper().strip()
- print "CBLAS routine:", match[1] , " BLAS equivalent:", blas_routine
+ fortran_routine = match[1].split("_sub")[0].upper().strip()
+ c_routine = prefix + match[1]
+
+ print "C" + parser_mode + " routine:", c_routine , " " + parser_mode + " equivalent:", fortran_routine
         arguments = {}
         for arg in match[2].replace('\n','').split( ',' ):
             arg = arg.strip()
@@ -36,12 +45,12 @@
 
         pp.pprint( arguments )
 
- if blas_routine in info_map:
- print "Found ", blas_routine, " in Fortran info_map."
- info_map[ blas_routine ][ "cblas_routine" ] = 'cblas_' + match[1]
+ if fortran_routine in info_map:
+ print "Found ", fortran_routine, " in Fortran info_map."
+ info_map[ fortran_routine ][ prefix + "routine" ] = c_routine
 
             # read aliases, if they are there
- my_key = blas_routine[ 1: ].lower() + '.all.cblas_alias'
+ my_key = fortran_routine[ 1: ].lower() + '.all.cblas_alias'
             alias_map = {}
             #print my_key
             if netlib.my_has_key( my_key, template_map ) != None:
@@ -54,7 +63,7 @@
 
             # Try to match and insert arguments
             # argument_map is the data gathered through the Fortran interface
- for arg in info_map[ blas_routine ][ 'argument_map' ]:
+ for arg in info_map[ fortran_routine ][ 'argument_map' ]:
                 cblas_arg = ''
                 if arg in arguments:
                     cblas_arg = arg
@@ -62,10 +71,10 @@
                     if alias_map[ arg ] in arguments:
                         cblas_arg = alias_map[ arg ]
 
- print "Looking for BLAS argument ", arg, " CBLAS equivalent: ", cblas_arg
+ print "Looking for " + parser_mode + " argument ", arg, " CBLAS equivalent: ", cblas_arg
                 if cblas_arg in arguments:
                     print "Found matching argument, inserting call_cblas_header stuff"
- call_cblas_header = info_map[ blas_routine ][ "argument_map" ][ arg ][ "code" ][ "call_blas_header" ]
+ call_cblas_header = info_map[ fortran_routine ][ "argument_map" ][ arg ][ "code" ][ "call_blas_header" ]
                     print "Original: ", call_cblas_header
                     if not arguments[ cblas_arg ][ "pointer" ]:
                         call_cblas_header = call_cblas_header.replace( "&", "" )
@@ -74,27 +83,34 @@
 
                     print "Result: ", call_cblas_header
                     if arg == 'UPLO':
- info_map[ blas_routine ][ "argument_map" ][ arg ][ "code" ][ "call_cblas_header" ] = \
- "cblas_option< UpLo >::value"
+ info_map[ fortran_routine ][ "argument_map" ][ arg ][ "code" ][ "call_" + prefix + "header" ] = \
+ prefix + "option< UpLo >::value"
                     elif arg == 'DIAG':
- info_map[ blas_routine ][ "argument_map" ][ arg ][ "code" ][ "call_cblas_header" ] = \
- "cblas_option< Diag >::value"
+ info_map[ fortran_routine ][ "argument_map" ][ arg ][ "code" ][ "call_" + prefix + "header" ] = \
+ prefix + "option< Diag >::value"
                     elif arg == 'SIDE':
- info_map[ blas_routine ][ "argument_map" ][ arg ][ "code" ][ "call_cblas_header" ] = \
- "cblas_option< Side >::value"
+ info_map[ fortran_routine ][ "argument_map" ][ arg ][ "code" ][ "call_" + prefix + "header" ] = \
+ prefix + "option< Side >::value"
                     elif arg == 'TRANS' or arg == 'TRANSA' or arg == 'TRANSB':
- info_map[ blas_routine ][ "argument_map" ][ arg ][ "code" ][ "call_cblas_header" ] = \
- "cblas_option< " + netlib.level0_types[ arg ] + " >::value"
+ info_map[ fortran_routine ][ "argument_map" ][ arg ][ "code" ][ "call_" + prefix + "header" ] = \
+ prefix + "option< " + netlib.level0_types[ arg ] + " >::value"
                     else:
- info_map[ blas_routine ][ "argument_map" ][ arg ][ "code" ][ "call_cblas_header" ] = call_cblas_header
+ info_map[ fortran_routine ][ "argument_map" ][ arg ][ "code" ][ "call_" + prefix + "header" ] = call_cblas_header
                 else:
- exit(0)
+ if arg == 'INFO' and return_type == 'int':
+ info_map[ fortran_routine ][ "argument_map" ][ arg ][ "code" ][ "call_" + prefix + "header" ] = None
+ print "INFO is the return type, adding it with code None"
+ elif arg == 'WORK' or arg == 'LWORK':
+ info_map[ fortran_routine ][ "argument_map" ][ arg ][ "code" ][ "call_" + prefix + "header" ] = None
+ info_map[ fortran_routine ][ "clapack_disable_workspace" ] = True
+ else:
+ exit(0)
 
             if "ORDER" in arguments:
                 print "Adding order argument."
- info_map[ blas_routine ][ "has_cblas_order_arg" ] = True
+ info_map[ fortran_routine ][ "has_" + prefix + "order_arg" ] = True
             else:
                 print "Not adding order argument."
- info_map[ blas_routine ][ "has_cblas_order_arg" ] = False
+ info_map[ fortran_routine ][ "has_" + prefix + "order_arg" ] = False
 
 

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py 2010-01-11 06:28:54 EST (Mon, 11 Jan 2010)
@@ -9,6 +9,7 @@
 #
 
 import netlib, bindings, documentation
+import cblas
 
 import re, os.path, copy
 from types import StringType
@@ -65,8 +66,6 @@
       '#include <boost/numeric/bindings/is_mutable.hpp>',
       #'#include <boost/numeric/bindings/traits/traits.hpp>',
       #'#include <boost/numeric/bindings/traits/type_traits.hpp>',
- '#include <boost/numeric/bindings/lapack/detail/lapack.h>',
- '#include <boost/numeric/bindings/lapack/detail/lapack_option.hpp>',
       #'#include <boost/mpl/bool.hpp>',
       '#include <boost/type_traits/is_same.hpp>',
       '#include <boost/type_traits/remove_const.hpp>',
@@ -77,32 +76,83 @@
 
     #
     # LEVEL 0 HANDLING
- #
+ #
+ # If the first subroutine has a clapack_ routine, assume we are going
+ # to provide specialisations
     overloads = ''
- for subroutine in subroutines:
- sub_template = template_map[ 'lapack_overloads' ]
- # add the argument list here
- arg_list = []
- lapack_arg_list = []
- typename_list = []
+ backend_includes = ''
+ if 'clapack_routine' in info_map[ subroutines[0] ]:
+ overloads = template_map[ 'backend_lapack_with_clapack' ]
+ backend_includes = template_map[ 'lapack_backend_includes_with_clapack' ]
+ else:
+ overloads = template_map[ 'backend_lapack_default' ]
+ backend_includes = template_map[ 'lapack_backend_includes_default' ]
+
+ for select_backend in [ 'lapack_overloads', 'clapack_overloads' ]:
+
+ sub_overloads = ''
+
+ for subroutine in subroutines:
+
+ sub_template = template_map[ select_backend ]
+ have_clapack = 'clapack_routine' in info_map[ subroutine ]
+ # add the argument list here
+ arg_list = []
+ lapack_arg_list = []
+ clapack_arg_list = []
+ typename_list = []
+ level0_static_asserts = []
+
+ for arg in info_map[ subroutine ][ 'arguments' ]:
+ print "Subroutine ", subroutine, " arg ", arg
+ if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_0' ] != None:
+ arg_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_0' ] ]
+ if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'call_lapack_header' ] != None:
+ lapack_arg_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'call_lapack_header' ] ]
+ if have_clapack and info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'call_clapack_header' ] != None:
+ clapack_arg_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'call_clapack_header' ] ]
+ if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_0_typename' ] != None:
+ typename_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_0_typename' ] ]
+
+ if "has_clapack_order_arg" in info_map[ subroutine ]:
+ if info_map[ subroutine ][ "has_clapack_order_arg" ] == True:
+ arg_list.insert( 0, "Order" )
+ clapack_arg_list.insert( 0, "clapack_option< Order >::value" )
+ typename_list.insert( 0, "typename Order" )
+ level0_static_asserts.append( "BOOST_STATIC_ASSERT( (is_same<Order, tag::column_major>::value) );" )
+ includes += [ "#include <boost/type_traits/is_same.hpp>" ]
+
+ sub_template = sub_template.replace( "$TYPES", ", ".join( typename_list ) )
+ sub_template = sub_template.replace( "template< >\n", "" )
+ sub_template = sub_template.replace( "$LEVEL0", ", ".join( arg_list ) )
+ sub_template = sub_template.replace( "$CALL_LAPACK_HEADER", ", ".join( lapack_arg_list ) )
+ sub_template = sub_template.replace( "$CALL_CLAPACK_HEADER", ", ".join( clapack_arg_list ) )
+ sub_template = sub_template.replace( "$SUBROUTINE", subroutine )
+ sub_template = sub_template.replace( '$groupname', group_name.lower() )
+ sub_template = sub_template.replace( "$SPECIALIZATION", documentation.routine_value_type[ subroutine[0] ] )
+ sub_template = sub_template.replace( '$STATIC_ASSERTS', "\n ".join( level0_static_asserts ) )
+
+ if select_backend == 'lapack_overloads':
+ sub_template = sub_template.replace( '$LIBRARY_INT_TYPE', "fortran_int_t" )
+ else:
+ sub_template = sub_template.replace( '$LIBRARY_INT_TYPE', "int" )
+
+ # CLAPACK stuff
+ if 'clapack_routine' in info_map[ subroutine ]:
+ clapack_routine = info_map[ subroutine ][ 'clapack_routine' ]
+ else:
+ clapack_routine = '// NOT FOUND'
+ sub_template = sub_template.replace( "$CLAPACK_ROUTINE", clapack_routine )
+
+
+ # Finalize this sub_overload
+ sub_overloads += bindings.proper_indent( sub_template )
+
+ # fill in for the appropriate back-end
+ print "Replacing ", '$' + select_backend.upper()
+ overloads = overloads.replace( '$' + select_backend.upper(),
+ sub_overloads )
 
- for arg in info_map[ subroutine ][ 'arguments' ]:
- arg_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_0' ] ]
- lapack_arg_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'call_lapack_header' ] ]
- if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_0_typename' ] != None:
- typename_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_0_typename' ] ]
-
- sub_template = sub_template.replace( "$TYPES", ", ".join( typename_list ) )
- sub_template = sub_template.replace( "template< >\n", "" )
- sub_template = sub_template.replace( "$LEVEL0", ", ".join( arg_list ) )
- sub_template = sub_template.replace( "$CALL_LAPACK_HEADER", ", ".join( lapack_arg_list ) )
- sub_template = sub_template.replace( "$SUBROUTINE", subroutine )
- sub_template = sub_template.replace( '$groupname', group_name.lower() )
- sub_template = sub_template.replace( "$SPECIALIZATION", documentation.routine_value_type[ subroutine[0] ] )
- sub_template = sub_template.replace( '$LIBRARY_INT_TYPE', "fortran_int_t" )
-
- overloads += bindings.proper_indent( sub_template )
-
     cases = {}
     # first, see what kind of functions we have
     # needed for argument check etc.
@@ -221,7 +271,8 @@
 
       # import the code, by argument
       for arg in info_map[ subroutine ][ 'arguments' ]:
- level0_arg_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'call_level_0' ] ]
+ if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'call_level_0' ] != None:
+ level0_arg_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'call_level_0' ] ]
         if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_1' ] != None:
           level1_arg_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_1' ] ]
         if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'level_2' ] != None:
@@ -252,6 +303,10 @@
           if info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'user_defined_init' ] != None:
             user_defined_opt_arg_list += [ info_map[ subroutine ][ 'argument_map' ][ arg ][ 'code' ][ 'user_defined_init' ] ]
 
+ # Insert the order_type() if appropriate
+ if "has_clapack_order_arg" in info_map[ subroutine ]:
+ level0_arg_list.insert( 0, "order()" )
+
       # Level 1 replacements
       level1_template = level1_template.replace( "$TYPEDEFS", "\n ".join( typedef_list ) )
       level1_template = level1_template.replace( "$CALL_LEVEL0", ", ".join( level0_arg_list ) )
@@ -453,6 +508,7 @@
 
     result = template_map[ 'lapack.hpp' ]
     result = result.replace( '$INCLUDES', includes_code )
+ result = result.replace( '$BACKEND_INCLUDES', backend_includes )
     result = result.replace( '$OVERLOADS', overloads )
     result = result.replace( '$LEVEL1', level1 )
     result = result.replace( '$LEVEL2', level2 )
@@ -517,6 +573,7 @@
   return result
 
 lapack_src_path = './lapack-3.2.0/SRC'
+clapack_h_path = './atlas-3.6.0/include/clapack.h'
 template_src_path = './templates'
 bindings_impl_target_path = '../../../../boost/numeric/bindings/lapack/'
 test_target_path = '../test/lapack/'
@@ -542,6 +599,8 @@
       print "Adding LAPACK subroutine", key
       function_info_map[ key ] = value
 
+cblas.parse_file( clapack_h_path, function_info_map, templates )
+
 print "Grouping subroutines..."
 
 value_type_groups = {}

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-11 06:28:54 EST (Mon, 11 Jan 2010)
@@ -114,6 +114,8 @@
             result = level0_types[ name ]
     if '*' not in result and '&' not in result and 'const ' in result:
         result = result.replace( 'const ', '' )
+ if name == 'INFO':
+ result = None
     return result
 
 def level0_typename( name, properties ):
@@ -240,6 +242,10 @@
 
   else:
     result = name.lower()
+
+ if name == 'INFO':
+ result = None
+
   return result
 
 
@@ -265,6 +271,9 @@
          result = result.replace( complex_float_type, "value_type" )
          result = result.replace( complex_double_type, "value_type" )
 
+ if name == 'INFO':
+ result = None
+
   return result
 
 

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/lapack.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/lapack.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/lapack.hpp 2010-01-11 06:28:54 EST (Mon, 11 Jan 2010)
@@ -16,6 +16,7 @@
 #define BOOST_NUMERIC_BINDINGS_LAPACK_$DIRNAME_$GROUPNAME_HPP
 
 $INCLUDES
+$BACKEND_INCLUDES
 
 namespace boost {
 namespace numeric {
@@ -48,13 +49,59 @@
 } // namespace boost
 
 #endif
+$TEMPLATE[lapack_backend_includes_with_clapack]
+
+//
+// The LAPACK-backend for $groupname is selected by defining a pre-processor
+// variable, which can be one of
+// * for ATLAS's CLAPACK, define BOOST_NUMERIC_BINDINGS_LAPACK_CLAPACK
+// * netlib-compatible LAPACK is the default
+//
+#if defined BOOST_NUMERIC_BINDINGS_LAPACK_CLAPACK
+#include <boost/numeric/bindings/lapack/detail/clapack.h>
+#include <boost/numeric/bindings/lapack/detail/clapack_option.hpp>
+#else
+#include <boost/numeric/bindings/lapack/detail/lapack.h>
+#include <boost/numeric/bindings/lapack/detail/lapack_option.hpp>
+#endif
+$TEMPLATE[lapack_backend_includes_default]
+
+//
+// The LAPACK-backend for $groupname is the netlib-compatible backend.
+//
+#include <boost/numeric/bindings/lapack/detail/lapack.h>
+#include <boost/numeric/bindings/lapack/detail/lapack_option.hpp>
+$TEMPLATE[backend_lapack_default]
+$LAPACK_OVERLOADS
+$TEMPLATE[backend_lapack_with_clapack]
+#if defined BOOST_NUMERIC_BINDINGS_LAPACK_CLAPACK
+$CLAPACK_OVERLOADS
+#else
+$LAPACK_OVERLOADS
+#endif
 $TEMPLATE[lapack_overloads]
 //
-// Overloaded function for dispatching to $SPECIALIZATION value-type.
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * $SPECIALIZATION value-type.
 //
 template< $TYPES >
-inline void $groupname( $LEVEL0 ) {
+inline $INTEGER_TYPE $groupname( $LEVEL0 ) {
+ $STATIC_ASSERTS
+ fortran_int_t info(0);
     LAPACK_$SUBROUTINE( $CALL_LAPACK_HEADER );
+ return info;
+}
+
+$TEMPLATE[clapack_overloads]
+//
+// Overloaded function for dispatching to
+// * ATLAS's CLAPACK backend, and
+// * $SPECIALIZATION value-type.
+//
+template< $TYPES >
+inline $INTEGER_TYPE $groupname( $LEVEL0 ) {
+ return $CLAPACK_ROUTINE( $CALL_CLAPACK_HEADER );
 }
 
 $TEMPLATE[lapack_include_hierarchy]
@@ -110,12 +157,12 @@
     // * Asserts that most arguments make sense.
     //
     template< $TYPES, $WORKSPACE_TYPENAMES >
- static void invoke( $LEVEL1, detail::workspace$WORKSPACE_SIZE< $WORKSPACE_TYPES > work ) {
+ static $INTEGER_TYPE invoke( $LEVEL1, detail::workspace$WORKSPACE_SIZE< $WORKSPACE_TYPES > work ) {
         $TYPEDEFS
         $STATIC_ASSERTS
         $INIT_USER_DEFINED_VARIABLES
         $ASSERTS
- detail::$groupname( $CALL_LEVEL0 );
+ return detail::$groupname( $CALL_LEVEL0 );
     }
 
     //
@@ -126,11 +173,11 @@
     // * Enables the unblocked algorithm (BLAS level 2)
     //
     template< $TYPES >
- static void invoke( $LEVEL1, minimal_workspace work ) {
+ static $INTEGER_TYPE invoke( $LEVEL1, minimal_workspace work ) {
         $TYPEDEFS
         $INIT_USER_DEFINED_VARIABLES
 $SETUP_MIN_WORKARRAYS_POST
- invoke( $CALL_LEVEL1, workspace( $TMP_WORKARRAYS ) );
+ return invoke( $CALL_LEVEL1, workspace( $TMP_WORKARRAYS ) );
     }
 
     //
@@ -141,7 +188,7 @@
     // * Enables the blocked algorithm (BLAS level 3)
     //
     template< $TYPES >
- static void invoke( $LEVEL1, optimal_workspace work ) {
+ static $INTEGER_TYPE invoke( $LEVEL1, optimal_workspace work ) {
         $TYPEDEFS
 $OPT_WORKSPACE_FUNC
     }
@@ -156,7 +203,7 @@
         $SETUP_OPT_WORKARRAYS_POST
         invoke( $CALL_LEVEL1, workspace( $TMP_WORKARRAYS ) );
 $TEMPLATE[level1_opt_workspace_is_min]
- invoke( $CALL_LEVEL1, minimal_workspace() );
+ return invoke( $CALL_LEVEL1, minimal_workspace() );
 $TEMPLATE[level2_workspace]
 //
 // Overloaded function for $groupname. Its overload differs for
@@ -164,10 +211,8 @@
 // * User-defined workspace
 //
 template< $TYPES, typename Workspace >
-inline std::ptrdiff_t $groupname( $LEVEL2, Workspace work ) {
- fortran_int_t info(0);
- $groupname_impl< typename value< $FIRST_TYPENAME >::type >::invoke( $CALL_LEVEL1, work );
- return info;
+inline $INTEGER_TYPE $groupname( $LEVEL2, Workspace work ) {
+ return $groupname_impl< typename value< $FIRST_TYPENAME >::type >::invoke( $CALL_LEVEL1, work );
 }
 
 //
@@ -176,10 +221,8 @@
 // * Default workspace-type (optimal)
 //
 template< $TYPES >
-inline std::ptrdiff_t $groupname( $LEVEL2 ) {
- fortran_int_t info(0);
- $groupname_impl< typename value< $FIRST_TYPENAME >::type >::invoke( $CALL_LEVEL1, optimal_workspace() );
- return info;
+inline $INTEGER_TYPE $groupname( $LEVEL2 ) {
+ return $groupname_impl< typename value< $FIRST_TYPENAME >::type >::invoke( $CALL_LEVEL1, optimal_workspace() );
 }
 $TEMPLATE[setup_min_workspace]
         bindings::detail::array< $WORKSPACE_TYPE > tmp_$NAME( min_size_$NAME( $CALL_MIN_SIZE ) );
@@ -190,7 +233,7 @@
     // Static member function that returns the minimum size of
     // workspace-array $NAME.
     //
- static std::ptrdiff_t min_size_$NAME( $ARGUMENTS ) {
+ static $INTEGER_TYPE min_size_$NAME( $ARGUMENTS ) {
         $MIN_SIZE
     }
 
@@ -205,11 +248,11 @@
     // * Asserts that most arguments make sense.
     //
     template< $TYPES >
- static void invoke( $LEVEL1 ) {
+ static $INTEGER_TYPE invoke( $LEVEL1 ) {
         $TYPEDEFS
         $STATIC_ASSERTS
         $ASSERTS
- detail::$groupname( $CALL_LEVEL0 );
+ return detail::$groupname( $CALL_LEVEL0 );
     }
 
 };
@@ -220,9 +263,7 @@
 $COMMENTS
 //
 template< $TYPES >
-inline std::ptrdiff_t $groupname( $LEVEL2 ) {
- fortran_int_t info(0);
- $groupname_impl< typename value< $FIRST_TYPENAME >::type >::invoke( $CALL_LEVEL1 );
- return info;
+inline $INTEGER_TYPE $groupname( $LEVEL2 ) {
+ return $groupname_impl< typename value< $FIRST_TYPENAME >::type >::invoke( $CALL_LEVEL1 );
 }
 $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