Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58608 - in sandbox/numeric_bindings-v1/libs/numeric/bindings: . blas/test
From: thomas.klimpel_at_[hidden]
Date: 2009-12-31 09:34:14


Author: klimpel
Date: 2009-12-31 09:34:13 EST (Thu, 31 Dec 2009)
New Revision: 58608
URL: http://svn.boost.org/trac/boost/changeset/58608

Log:
Continue merging of different numeric-bindings.jam configuration files

Text files modified:
   sandbox/numeric_bindings-v1/libs/numeric/bindings/blas/test/blas1.cpp | 5 +++--
   sandbox/numeric_bindings-v1/libs/numeric/bindings/blas/test/blas3.cpp | 10 +++++++++-
   sandbox/numeric_bindings-v1/libs/numeric/bindings/numeric-bindings.jam | 21 ++++++++++++++++-----
   3 files changed, 28 insertions(+), 8 deletions(-)

Modified: sandbox/numeric_bindings-v1/libs/numeric/bindings/blas/test/blas1.cpp
==============================================================================
--- sandbox/numeric_bindings-v1/libs/numeric/bindings/blas/test/blas1.cpp (original)
+++ sandbox/numeric_bindings-v1/libs/numeric/bindings/blas/test/blas1.cpp 2009-12-31 09:34:13 EST (Thu, 31 Dec 2009)
@@ -161,18 +161,19 @@
   template <typename W>
   int operator()(W& w) const {
      using namespace boost::numeric::bindings::blas ;
+ real_type safety_factor (1.5);
 
      copy_vector(w);
 
      // Test blas routines
      value_type prod = dot( this->v_, w );
      if ( std::abs(prod - inner_prod( this->v1_ref_, this->v2_ref_ ))
- > std::numeric_limits< real_type >::epsilon() * std::abs(prod)) return 255 ;
+ > safety_factor*std::numeric_limits< real_type >::epsilon() * std::abs(prod)) return 255 ;
 
      axpy( value_type(2.0), this->v_, w );
      for (size_t i=0; i<this->size(); ++i)
         if ( std::abs(w[i] - (this->v2_ref_(i) + value_type(2.0)*this->v1_ref_(i)))
- > std::numeric_limits< real_type >::epsilon() * std::abs(w[i])) return 255 ;
+ > safety_factor*std::numeric_limits< real_type >::epsilon() * std::abs(w[i])) return 255 ;
 
      scal( value_type(0.0), w ) ;
      copy( this->v_, w ) ;

Modified: sandbox/numeric_bindings-v1/libs/numeric/bindings/blas/test/blas3.cpp
==============================================================================
--- sandbox/numeric_bindings-v1/libs/numeric/bindings/blas/test/blas3.cpp (original)
+++ sandbox/numeric_bindings-v1/libs/numeric/bindings/blas/test/blas3.cpp 2009-12-31 09:34:13 EST (Thu, 31 Dec 2009)
@@ -207,8 +207,9 @@
       value_type beta = -3.0 ;
 
       boost::numeric::bindings::blas::gemm( 'N', 'N', alpha, a_, b_, beta, c ) ;
+ double safety_factor (1.5);
       if ( norm_frobenius( c - (beta*c_ref_ + alpha * prod( a_ref_, b_ref_ ) ) )
- > std::numeric_limits< real_type >::epsilon() * norm_frobenius( c ) ) return 255;
+ > safety_factor*std::numeric_limits< real_type >::epsilon() * norm_frobenius( c ) ) return 255;
 
       return 0;
    }
@@ -376,12 +377,15 @@
 template <typename T>
 int do_value_type() {
    // Gemm test
+ std::cout << " gemm\n";
    if (do_matrix_types( Gemm1<T>() )) return 255 ;
 
    // Syrk and herk test
+ std::cout << " herk\n";
    if (do_matrix_types( Syrk1<T>() )) return 255 ;
 
    // Trsm test
+ std::cout << " trsm\n";
    if (do_matrix_types( Trsm1<T>() )) return 255 ;
 
    return 0 ;
@@ -390,9 +394,13 @@
 
 int main() {
    // Test for various value_types
+ std::cout << "float\n";
    if (do_value_type<float>()) return 255 ;
+ std::cout << "double\n";
    if (do_value_type<double>()) return 255 ;
+ std::cout << "complex<float>\n";
    if (do_value_type<std::complex<float> >()) return 255 ;
+ std::cout << "complex<double>\n";
    if (do_value_type<std::complex<double> >()) return 255 ;
 
    std::cout << "Regression test succeeded\n" ;

Modified: sandbox/numeric_bindings-v1/libs/numeric/bindings/numeric-bindings.jam
==============================================================================
--- sandbox/numeric_bindings-v1/libs/numeric/bindings/numeric-bindings.jam (original)
+++ sandbox/numeric_bindings-v1/libs/numeric/bindings/numeric-bindings.jam 2009-12-31 09:34:13 EST (Thu, 31 Dec 2009)
@@ -21,12 +21,16 @@
 NUMERIC_INCLUDE ?= /usr/local/lib ;
 SUITESPARSE_INCLUDE ?= $(NUMERIC_INCLUDE)/SuiteSparse ;
 
+FORTRAN_PATH ?= $(NUMERIC_LIB_PATH) ;
+
 ACML_DLL_PATH ?= /AMD/acml4.2.0/ifort32/lib ;
 ACML_FORTRAN_DLL ?= libifcoremd ;
 ACML_DLL ?= libacml_dll ;
 ACML_PATH ?= $(NUMERIC_LIB_PATH) ;
 ACML_LIB ?= acml ;
 
+MKL_PATH ?= $(NUMERIC_LIB_PATH) ;
+
 AMOS_PATH ?= $(NUMERIC_LIB_PATH) ;
 AMOS_LIB ?= amos ;
 
@@ -62,11 +66,16 @@
 lib msvc_acml_lib : : <name>$(ACML_DLL) <search>$(ACML_DLL_PATH) <toolset>msvc:<link>shared <use>msvc_acml_fortran_lib
              : : <define>BIND_FORTRAN_NO_F2C_RETURN_CONVENTIONS <library>msvc_acml_fortran_lib ;
 
+lib mkl_core_lib : : <name>mkl_core <search>$(MKL_PATH)
+ : : <define>BIND_FORTRAN_NO_F2C_RETURN_CONVENTIONS ;
+lib mkl_c_lib : : <name>mkl_intel_lp64 <search>$(MKL_PATH) ;
+lib mkl_seq_lib : : <name>mkl_sequential <search>$(MKL_PATH) ;
 
-lib gfortran_fortran_lib : : <name>gfortran
+
+lib gfortran_fortran_lib : : <name>gfortran <search>$(FORTRAN_PATH)
                          : : <define>BIND_FORTRAN_NO_F2C_RETURN_CONVENTIONS ;
-lib g77_fortran_lib : : <name>g2c ;
-lib msvc_fortran_lib : : <name>libf2c <search>$(BLAS_PATH)
+lib g77_fortran_lib : : <name>g2c <search>$(FORTRAN_PATH) ;
+lib msvc_fortran_lib : : <name>libf2c <search>$(FORTRAN_PATH)
                 : : <define>BIND_FORTRAN_LOWERCASE_UNDERSCORE
                     <toolset>msvc:<linkflags>/NODEFAULTLIB:LIBCMT ;
 
@@ -82,8 +91,8 @@
               : : <include>$(ATLAS_INCLUDE) ;
 lib cblas_lib : : <name>$(CBLAS_LIB) <search>$(ATLAS_PATH)
               : : <include>$(ATLAS_INCLUDE) ;
-lib lapack_atlas_lib : fortran_lib : <name>$(LAPACK_ATLAS_LIB) <search>$(ATLAS_PATH)
- : : <include>$(ATLAS_INCLUDE) ;
+lib lapack_atlas_lib : : <name>$(LAPACK_ATLAS_LIB) <search>$(ATLAS_PATH)
+ : : <include>$(ATLAS_INCLUDE) ;
 
 lib f_blas_lib : fortran_lib : <name>$(BLAS_LIB) <search>$(BLAS_PATH) ;
 lib f_lapack_lib : fortran_lib : <name>$(LAPACK_LIB) <search>$(LAPACK_PATH) <use>blas_lib
@@ -95,6 +104,7 @@
 alias blas_lib : f_blas_lib : <numbind>clapack-gcc ;
 alias blas_lib : acml_lib : <numbind>acml-gcc ;
 alias blas_lib : msvc_acml_lib : <numbind>acml-msvc ;
+alias blas_lib : mkl_core_lib mkl_c_lib mkl_seq_lib : <numbind>mkl-gcc ;
 alias lapack_lib : f_lapack_lib ;
 alias lapack_lib : f_lapack_lib : <numbind>gfortran ;
 alias lapack_lib : f_lapack_lib : <numbind>g77 ;
@@ -103,6 +113,7 @@
                  : : <library>blas_lib ;
 alias lapack_lib : msvc_acml_lib : <use>blas_lib <numbind>acml-msvc
                  : : <library>blas_lib ;
+alias lapack_lib : mkl_core_lib mkl_c_lib mkl_seq_lib : <numbind>mkl-gcc ;
 
 lib pthread ;
 lib mpiseq : : <search>$(MUMPS_PATH)/../libseq ;


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