|
Ublas : |
From: Manuel González Castro (iinmgc00_at_[hidden])
Date: 2006-01-17 08:09:10
Hello,
I am developing an engineering application using uBlas. In the future I would like to use the ATLAS bindings to perform BLAS operations in my code, and I would like to do it without changing my code.
Since uBLAS defines a BLAS interface (blas.hpp) within the namespaces boost::numeric::blas_[1/2/3], I thought that I could do something like:
#ifdef USE_BLAS_FROM_UBLAS
#include <boost/numeric/ublas/blas.hpp>
#using namespace boost::numeric::ublas_1;
#using namespace boost::numeric::ublas_2;
#using namespace boost::numeric::ublas_3;
#endif
#ifdef USE_BLAS_FROM_ATLAS
#include <boost/numeric/bindings/atlas/cblas.hpp>
#using namespace boost::numeric::bindings::atlas;
#endif
But this solution is not valid because the BLAS function declarations (name and order or arguments) are different in uBLAS and the ATLAS binding. Example:
[y <- a A x + b y] in uBLAS BLAS: gmv (y,b,a,A,x)
[y <- a A x + b y] in ATLAS binding: gemv(a,A,x,b,y)
The only solution I see is to rewrite blas.hpp in uBlas to use the same interface as the ATLAS binding.
Is there any reason to define a BLAS interface in uBLAS that differs from the interface provided by the ATLAS binding (which I consider closer to the original BLAS specification)?
Thanks a lot,
Manuel