|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51714 - in sandbox/numeric_bindings: boost/numeric/bindings/blas/level3 libs/numeric/bindings/tools libs/numeric/bindings/tools/templates/level3
From: rutger_at_[hidden]
Date: 2009-03-11 15:26:43
Author: rutger
Date: 2009-03-11 15:26:42 EDT (Wed, 11 Mar 2009)
New Revision: 51714
URL: http://svn.boost.org/trac/boost/changeset/51714
Log:
Fixed gemm's #rows trait, added template override
Added:
sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level3/gemm.hpp (contents, props changed)
Text files modified:
sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/gemm.hpp | 25 ++++++++++++-------------
sandbox/numeric_bindings/libs/numeric/bindings/tools/netlib.py | 10 +++++++++-
2 files changed, 21 insertions(+), 14 deletions(-)
Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/gemm.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/gemm.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/level3/gemm.hpp 2009-03-11 15:26:42 EDT (Wed, 11 Mar 2009)
@@ -75,19 +75,19 @@
// templated specialization
template< typename MatrixA, typename MatrixB, typename MatrixC >
static return_type compute( char const transa, char const transb,
- integer_t const m, integer_t const k, value_type const alpha,
- MatrixA& a, MatrixB& b, value_type const beta, MatrixC& c ) {
+ integer_t const k, value_type const alpha, MatrixA& a, MatrixB& b,
+ value_type const beta, MatrixC& c ) {
BOOST_STATIC_ASSERT( (boost::is_same< typename traits::matrix_traits<
MatrixA >::value_type, typename traits::matrix_traits<
MatrixB >::value_type >::value) );
BOOST_STATIC_ASSERT( (boost::is_same< typename traits::matrix_traits<
MatrixA >::value_type, typename traits::matrix_traits<
MatrixC >::value_type >::value) );
- detail::gemm( transa, transb, m, traits::matrix_num_columns(c),
- k, alpha, traits::matrix_storage(a),
- traits::leading_dimension(a), traits::matrix_storage(b),
- traits::leading_dimension(b), beta, traits::matrix_storage(c),
- traits::leading_dimension(c) );
+ detail::gemm( transa, transb, traits::matrix_num_rows(c),
+ traits::matrix_num_columns(c), k, alpha,
+ traits::matrix_storage(a), traits::leading_dimension(a),
+ traits::matrix_storage(b), traits::leading_dimension(b), beta,
+ traits::matrix_storage(c), traits::leading_dimension(c) );
}
};
@@ -95,13 +95,12 @@
template< typename MatrixA, typename MatrixB, typename MatrixC >
inline typename gemm_impl< typename traits::matrix_traits<
MatrixA >::value_type >::return_type
-gemm( char const transa, char const transb, integer_t const m,
- integer_t const k, typename traits::matrix_traits<
- MatrixA >::value_type const alpha, MatrixA& a, MatrixB& b,
- typename traits::matrix_traits< MatrixA >::value_type const beta,
- MatrixC& c ) {
+gemm( char const transa, char const transb, integer_t const k,
+ typename traits::matrix_traits< MatrixA >::value_type const alpha,
+ MatrixA& a, MatrixB& b, typename traits::matrix_traits<
+ MatrixA >::value_type const beta, MatrixC& c ) {
typedef typename traits::matrix_traits< MatrixA >::value_type value_type;
- gemm_impl< value_type >::compute( transa, transb, m, k, alpha, a, b,
+ gemm_impl< value_type >::compute( transa, transb, k, alpha, a, b,
beta, c );
}
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 2009-03-11 15:26:42 EDT (Wed, 11 Mar 2009)
@@ -951,7 +951,7 @@
argument_properties[ 'trait_type' ] = 'num_columns'
argument_properties[ 'trait_of' ] = match_matrix_traits[0][3].strip()
-
+ # if we're not dealing with order
else:
references = match_matrix_traits[0][3].split( 'and' )
for matrix_name in references:
@@ -959,6 +959,14 @@
argument_properties[ 'trait_type' ] = 'num_' + match_matrix_traits[0][0]
argument_properties[ 'trait_of' ] = matrix_name.strip()
+ # if we have found no matches .. perhaps there's something in the templating system
+ else:
+ traits_key = subroutine_group_name.lower() + '.' + subroutine_value_type + '.' + argument_name + '.trait'
+ if my_has_key( traits_key, template_map ):
+ data = template_map[ my_has_key( traits_key, template_map ) ].split(",")
+ argument_properties[ 'trait_type' ] = data[0].strip()
+ argument_properties[ 'trait_of' ] = data[1].strip()
+
#
# Fetch array traits, such as "the length of the array WORK"
#
Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level3/gemm.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/level3/gemm.hpp 2009-03-11 15:26:42 EDT (Wed, 11 Mar 2009)
@@ -0,0 +1,3 @@
+$TEMPLATE[gemm.all.M.trait]
+num_rows,C
+$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