Skip to content
Snippets Groups Projects
Commit bdf74dca authored by Christian Engwer's avatar Christian Engwer
Browse files

[densematrix] use the correct scaling parameter for usmv and friends

In the current state the scaling parameter for matrix-vector products
(e.g. the alpha parameter for DenseMatrix<...>::usmv) is the
field_type of the matrix. I you consider mixed precision, like in the
xblas library, you would actually want the scaling to be of the same
accuracy as the output vector; an other reason is vectorization for
one matrix and multiple vectors.

The patch contains two changes:

a) the FieldTraits are extended, so that the contain specializations
   for C and C++ vectors
b) the thre matrix implementations are changed, such that they deduce
   the type as FieldTraits<Y>::field_type, where Y is the type of the
   result vector.

In the case of identity matrix the old implementation was laso completely wrong, as it used
Y::axpy to implement usmv and Y::axpy expects alpha to be Y::value_type, so that we already
had a type clash, which just went unnoticed, as we never used mixed-types.
parent d33190bc
No related branches found
No related tags found
1 merge request!10Feature/fix mixed precision dense matrix vector interface
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment