Commit 4f8ff2c3 authored by Davis King's avatar Davis King

- There were a few expressions that should have been bound to BLAS

    calls but weren't getting properly bound.  This has now been fixed.
  - There were a few cases where the code wouldn't compile when using
    complex numbers.  There was also a runtime bug that triggered when
    a rank 1 update was performed where one of the vectors was conjugated
    and two or more transposes were used in certain positions.  This bug
    caused the wrong output to be computed if the BLAS bindings were used.
    Both of these bugs have been fixed.
  - Added hooks for the blas binding counters that are used by the
    new blas_bindings regression tests.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403287
parent 899a3c63
......@@ -176,7 +176,7 @@ namespace dlib
// a temporary 1x1 matrix so that the expression will encounter
// all the overloads of matrix_assign() and have the chance to
// go through any applicable optimizations.
matrix<type,1,1> temp(ref());
matrix<type,1,1,mem_manager_type,layout_type> temp(ref());
return temp(0);
}
......@@ -266,8 +266,15 @@ namespace dlib
const static long NR = LHS::NR;
const static long NC = RHS::NC;
#ifdef DLIB_USE_BLAS
// if there are BLAS functions to be called then we want to make sure we
// always evaluate any complex expressions so that the BLAS bindings can happen.
const static bool lhs_is_costly = (LHS::cost > 1)&&(RHS::NC != 1 || LHS::cost >= 10000);
const static bool rhs_is_costly = (RHS::cost > 1)&&(LHS::NR != 1 || RHS::cost >= 10000);
#else
const static bool lhs_is_costly = (LHS::cost > 4)&&(RHS::NC != 1);
const static bool rhs_is_costly = (RHS::cost > 4)&&(LHS::NR != 1);
#endif
// Note that if we decide that one of the matrices is too costly we will evaluate it
// into a temporary. Doing this resets its cost back to 1.
......
......@@ -216,7 +216,7 @@ namespace dlib
{
if (add_to)
{
if (alpha == 1)
if (alpha == static_cast<typename EXP2::type>(1))
{
for (long c = 0; c < src.nc(); ++c)
{
......@@ -226,7 +226,7 @@ namespace dlib
}
}
}
else if (alpha == -1)
else if (alpha == static_cast<typename EXP2::type>(-1))
{
for (long c = 0; c < src.nc(); ++c)
{
......@@ -249,7 +249,7 @@ namespace dlib
}
else
{
if (alpha == 1)
if (alpha == static_cast<typename EXP2::type>(1))
{
for (long c = 0; c < src.nc(); ++c)
{
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment