Skip to content

Commit

Permalink
Merge pull request #17739 from JuliaLang/kc/scale
Browse files Browse the repository at this point in the history
fix fallback for scaling blas number with array
  • Loading branch information
KristofferC authored Aug 2, 2016
2 parents 1fde9d6 + 7da18ed commit 633443c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base/linalg/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const ASUM_CUTOFF = 32
const NRM2_CUTOFF = 32

function scale!{T<:BlasFloat}(X::Array{T}, s::T)
s == 0 && return fill!(X, zero(T))
s == 1 && return X
if length(X) < SCAL_CUTOFF
generic_scale!(X, s)
else
Expand All @@ -18,6 +20,8 @@ function scale!{T<:BlasFloat}(X::Array{T}, s::T)
X
end

scale!{T<:BlasFloat}(s::T, X::Array{T}) = scale!(X, s)

scale!{T<:BlasFloat}(X::Array{T}, s::Number) = scale!(X, convert(T, s))
function scale!{T<:BlasComplex}(X::Array{T}, s::Real)
R = typeof(real(zero(T)))
Expand Down

2 comments on commit 633443c

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

Please sign in to comment.