Skip to content

Commit

Permalink
Merge pull request #15824 from JuliaLang/anj/sgesdd
Browse files Browse the repository at this point in the history
Redoing #15796 but now with comments and test
  • Loading branch information
andreasnoack committed Apr 15, 2016
2 parents ecc39ac + b6988df commit 9492c53
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions base/linalg/lapack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1572,6 +1572,11 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in
end
chklapackerror(info[])
if i == 1
# Work around issue with truncated Float32 representation of lwork in
# sgesdd by using nextfloat. See
# http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=13&t=4587&p=11036&hilit=sgesdd#p11036
# and
# https://github.com/scipy/scipy/issues/5401
lwork = round(BlasInt, nextfloat(real(work[1])))
work = Array($elty, lwork)
end
Expand Down
7 changes: 7 additions & 0 deletions test/perf/lapack/perf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ include("../perfutil.jl")

include("eig.jl")
include("factorizations.jl")

# The test below is not a perf test but it takes too long for the normal test suite.
# This tests a work around for a bug in LAPACK where the work space is truncated
# to a too small number because the number is too big to be represented as a Float32.
# See the calculation for lwork in our sgesdd wrapper in lapack.jl.
println("testing work space bug in sgesdd")
svd(rand(Float32, 9537, 9537))

0 comments on commit 9492c53

Please sign in to comment.