|
Ublas : |
Subject: Re: [ublas] [bindings] New traits system
From: Jesse (jesseperla_at_[hidden])
Date: 2010-01-09 10:23:25
Rutger ter Borg <rutger <at> terborg.net> writes:
> Jesse wrote:
>
> > Great, I am now updated. A few things:
All of your fixes worked well. See my previous post on gelsd for my hack that
got it working.
>
> Have you already checked out the new gemm? It is able to handle all cases
> that we discussed a couple of months ago (passing row major gets transposed,
> etc.).
The interface looks impressive. I just gave it a shot and got a compile error
(using ublas matrices and the appropriate trait loaded). It looks like the
AssociatedSequence type isn't being loaded correctly? Perhaps a missing
header I can't figure out?
Here are my traits includes(overkill, my file is doing more):
#include<boost/numeric/bindings/lower.hpp>
#include <boost/numeric/bindings/trans.hpp>
#include <boost/numeric/bindings/conj.hpp>
#include <boost/numeric/bindings/data_order.hpp>
#include <boost/numeric/bindings/data_side.hpp>
//Traits for types we are using.
#include <boost/numeric/bindings/ublas/matrix.hpp>
#include <boost/numeric/bindings/ublas/triangular.hpp>
#include <boost/numeric/bindings/ublas/vector.hpp>
#include <boost/numeric/bindings/std/vector.hpp>
//Routines from BLAS bindings
#include <boost/numeric/bindings/blas/level3/gemm.hpp>
Here is the beginning of the spew(looks like it can't lookup traits tags
from the AssociativeSequence on the ublas::matrix?
1>rder, TransA, TransB, fortran_int_t={int}, fortran_int_t={int},
fortran_int_t={int}, double, const double *, fortran_int_t={int}, const double
*, fortran_int_t={int}, double, double *, fortran_int_t={int}) [with
Order=boost::numeric::bindings::tag::column_major,
TransA=boost::numeric::bindings::tag::no_transpose,
TransB=boost::numeric::bindings::tag::no_transpose]" at line 281 of
1>
"C:\working\libraries\boost_sandbox\boost/numeric/bindings/blas/level3/gemm.hpp"
1> instantiation of "void
boost::numeric::bindings::blas::gemm_impl<Value>::invoke(Value, const MatrixA &,
const MatrixB &, Value, MatrixC &) [with Value=double,
MatrixA=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>,
MatrixB=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>,
1> MatrixC=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>]" at
line 303 of
"C:\working\libraries\boost_sandbox\boost/numeric/bindings/blas/level3/gemm.hpp"
1> instantiation of
"boost::numeric::bindings::blas::gemm_impl<boost::numeric::bindings::value<T>::t
ype>::return_type
boost::numeric::bindings::blas::gemm(boost::numeric::bindings::value<T>::type,
const MatrixA &, const MatrixB &, boost::numeric::bindings::value<T>::type,
MatrixC &) [with MatrixA=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>,
1> MatrixB=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>,
MatrixC=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>]" at
line 303 of
"C:\working\libraries\etk\tests\linear_algebra\bindings\test_ublas_bindings.cpp"
1>
1>C:\working\libraries\boost\boost/mpl/has_key.hpp(32): error: class
"boost::mpl::has_key_impl<boost::mpl::non_sequence_tag>" has no member class
"apply"
1> ::template apply<AssociativeSequence,Key>
1> ^
1> detected during:
1> instantiation of class "boost::mpl::has_key<AssociativeSequence,
Key> [with AssociativeSequence=<error-type>,
Key=boost::numeric::bindings::tag::data_order]" at line 26 of
"C:\working\libraries\boost_sandbox\boost/numeric/bindings/detail/property_map.h
pp"
1> instantiation of class
"boost::numeric::bindings::detail::property_has_key<T, Key> [with
T=boost::numeric::bindings::tag::column_major,
Key=boost::numeric::bindings::tag::data_order]" at line 63 of
"C:\working\libraries\boost\boost/mpl/if.hpp"
1> instantiation of class "boost::mpl::if_<T1, T2, T3> [with
T1=boost::numeric::bindings::detail::property_has_key<boost::numeric::bindings::
tag::column_major, boost::numeric::bindings::tag::data_order>,
T2=boost::numeric::bindings::detail::is_same_at<boost::numeric::bindings::tag::c
olumn_major, boost::numeric::bindings::tag::data_order,
boost::numeric::bindings::tag::column_major>, T3=boost::mpl::true_]" at line 26
of
1>
"C:\working\libraries\boost_sandbox\boost/numeric/bindings/is_column_major.hpp"
1> instantiation of class
"boost::numeric::bindings::is_column_major<T> [with
T=boost::numeric::bindings::tag::column_major]" at line 204 of
"C:\working\libraries\boost_sandbox\boost/numeric/bindings/blas/level3/gemm.hpp"
1> instantiation of "void
boost::numeric::bindings::blas::detail::gemm(Order, TransA, TransB,
fortran_int_t={int}, fortran_int_t={int}, fortran_int_t={int}, double, const
double *, fortran_int_t={int}, const double *, fortran_int_t={int}, double,
double *, fortran_int_t={int}) [with
Order=boost::numeric::bindings::tag::column_major,
TransA=boost::numeric::bindings::tag::no_transpose,
TransB=boost::numeric::bindings::tag::no_transpose]" at line 281 of
1>
"C:\working\libraries\boost_sandbox\boost/numeric/bindings/blas/level3/gemm.hpp"
1> instantiation of "void
boost::numeric::bindings::blas::gemm_impl<Value>::invoke(Value, const MatrixA &,
const MatrixB &, Value, MatrixC &) [with Value=double,
MatrixA=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>,
MatrixB=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>,
1> MatrixC=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>]" at
line 303 of
"C:\working\libraries\boost_sandbox\boost/numeric/bindings/blas/level3/gemm.hpp"
1> instantiation of
"boost::numeric::bindings::blas::gemm_impl<boost::numeric::bindings::value<T>::t
ype>::return_type
boost::numeric::bindings::blas::gemm(boost::numeric::bindings::value<T>::type,
const MatrixA &, const MatrixB &, boost::numeric::bindings::value<T>::type,
MatrixC &) [with MatrixA=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>,
1> MatrixB=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>>>,
MatrixC=boost::numeric::ublas::matrix<double,
boost::numeric::ublas::column_major,
boost::numeric::ublas::unbounded_array<double, std::