Skip to content

Commit

Permalink
add missing ger syr her
Browse files Browse the repository at this point in the history
  • Loading branch information
N5N3 committed Nov 6, 2021
1 parent b8f4ab7 commit 55f1c1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
19 changes: 9 additions & 10 deletions stdlib/LinearAlgebra/src/blas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1279,13 +1279,12 @@ for (fname, elty) in ((:dger_,:Float64),
if m != length(x) || n != length(y)
throw(DimensionMismatch("A has size ($m,$n), x has length $(length(x)), y has length $(length(y))"))
end
ccall((@blasfunc($fname), libblastrampoline), Cvoid,
(px, stx), (py, sty) = ptrst1(x), ptrst1(y)
GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid,
(Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty},
Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty},
Ref{BlasInt}),
m, n, α, x,
stride(x, 1), y, stride(y, 1), A,
max(1,stride(A,2)))
m, n, α, px, stx, py, sty, A, max(1,stride(A,2)))
A
end
end
Expand All @@ -1312,11 +1311,11 @@ for (fname, elty, lib) in ((:dsyr_,:Float64,libblastrampoline),
if length(x) != n
throw(DimensionMismatch("A has size ($n,$n), x has length $(length(x))"))
end
ccall((@blasfunc($fname), $lib), Cvoid,
px, stx = ptrst1(x)
GC.@preserve x ccall((@blasfunc($fname), $lib), Cvoid,
(Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty},
Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}),
uplo, n, α, x,
stride(x, 1), A, max(1,stride(A, 2)))
uplo, n, α, px, stx, A, max(1,stride(A, 2)))
A
end
end
Expand All @@ -1342,11 +1341,11 @@ for (fname, elty, relty) in ((:zher_,:ComplexF64, :Float64),
if length(x) != n
throw(DimensionMismatch("A has size ($n,$n), x has length $(length(x))"))
end
ccall((@blasfunc($fname), libblastrampoline), Cvoid,
px, stx = ptrst1(x)
GC.@preserve x ccall((@blasfunc($fname), libblastrampoline), Cvoid,
(Ref{UInt8}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty},
Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong),
uplo, n, α, x,
stride(x, 1), A, max(1,stride(A,2)), 1)
uplo, n, α, px, stx, A, max(1,stride(A,2)), 1)
A
end
end
Expand Down
4 changes: 2 additions & 2 deletions stdlib/LinearAlgebra/test/blas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ Random.seed!(100)
@test_throws DimensionMismatch BLAS.trsv('U','N','N',A,Vector{elty}(undef,n+1))
end
end
@testset "ger, her, syr" for x in (rand(elty, n), view(rand(elty,2n), 1:2:2n)),
y in (rand(elty,n), view(rand(elty,3n), 1:3:3n))
@testset "ger, her, syr" for x in (rand(elty, n), view(rand(elty,2n), 1:2:2n), view(rand(elty,2n), 2n:-2:1)),
y in (rand(elty,n), view(rand(elty,3n), 1:3:3n), view(rand(elty,3n), 3n:-3:1))

A = rand(elty,n,n)
α = rand(elty)
Expand Down

0 comments on commit 55f1c1b

Please sign in to comment.