Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only apply the gemv workaround when OpenBLAS is being used. #6978

Merged
merged 1 commit into from
May 27, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions base/linalg/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -203,25 +203,24 @@ function copytri!(A::StridedMatrix, uplo::Char, conjugate::Bool=false)
A
end

gemv!{T<:BlasFloat}(y::StridedVector{T}, tA::Char, A::StridedMatrix{T}, x::StridedVector{T}) = generic_matvecmul!(y, tA, A, x)

## Avoid calling BLAS.gemv! until #6941 is fixed.
# function gemv!{T<:BlasFloat}(y::StridedVector{T}, tA::Char, A::StridedMatrix{T}, x::StridedVector{T})

# stride(A, 1)==1 || return generic_matvecmul!(y, tA, A, x)

# if tA != 'N'
# (nA, mA) = size(A)
# else
# (mA, nA) = size(A)
# end

# nA==length(x) || throw(DimensionMismatch(""))
# mA==length(y) || throw(DimensionMismatch(""))
# mA == 0 && return zeros(T, 0)
# nA == 0 && return zeros(T, mA)
# return BLAS.gemv!(tA, one(T), A, x, zero(T), y)
# end
if Base.blas_vendor() == :openblas
## Avoid calling BLAS.gemv! when OpenBLAS is being used until #6941 is fixed.
gemv!{T<:BlasFloat}(y::StridedVector{T}, tA::Char, A::StridedMatrix{T}, x::StridedVector{T}) = generic_matvecmul!(y, tA, A, x)
else
function gemv!{T<:BlasFloat}(y::StridedVector{T}, tA::Char, A::StridedMatrix{T}, x::StridedVector{T})
stride(A, 1)==1 || return generic_matvecmul!(y, tA, A, x)
if tA != 'N'
(nA, mA) = size(A)
else
(mA, nA) = size(A)
end
nA==length(x) || throw(DimensionMismatch(""))
mA==length(y) || throw(DimensionMismatch(""))
mA == 0 && return zeros(T, 0)
nA == 0 && return zeros(T, mA)
return BLAS.gemv!(tA, one(T), A, x, zero(T), y)
end
end

function syrk_wrapper!{T<:BlasFloat}(C::StridedMatrix{T}, tA::Char, A::StridedMatrix{T})
nC = chksquare(C)
Expand Down