Skip to content

Commit d755559

Browse files
committed
add missing ger syr her
1 parent ae03b42 commit d755559

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

stdlib/LinearAlgebra/src/blas.jl

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,13 +1279,12 @@ for (fname, elty) in ((:dger_,:Float64),
12791279
if m != length(x) || n != length(y)
12801280
throw(DimensionMismatch("A has size ($m,$n), x has length $(length(x)), y has length $(length(y))"))
12811281
end
1282-
ccall((@blasfunc($fname), libblastrampoline), Cvoid,
1282+
(px, stx), (py, sty) = ptrst1(x), ptrst1(y)
1283+
GC.@preserve x y ccall((@blasfunc($fname), libblastrampoline), Cvoid,
12831284
(Ref{BlasInt}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty},
12841285
Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Ptr{$elty},
12851286
Ref{BlasInt}),
1286-
m, n, α, x,
1287-
stride(x, 1), y, stride(y, 1), A,
1288-
max(1,stride(A,2)))
1287+
m, n, α, px, stx, py, sty, A, max(1,stride(A,2)))
12891288
A
12901289
end
12911290
end
@@ -1312,11 +1311,11 @@ for (fname, elty, lib) in ((:dsyr_,:Float64,libblastrampoline),
13121311
if length(x) != n
13131312
throw(DimensionMismatch("A has size ($n,$n), x has length $(length(x))"))
13141313
end
1315-
ccall((@blasfunc($fname), $lib), Cvoid,
1314+
px, stx = ptrst1(x)
1315+
GC.@preserve x ccall((@blasfunc($fname), $lib), Cvoid,
13161316
(Ref{UInt8}, Ref{BlasInt}, Ref{$elty}, Ptr{$elty},
13171317
Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}),
1318-
uplo, n, α, x,
1319-
stride(x, 1), A, max(1,stride(A, 2)))
1318+
uplo, n, α, px, stx, A, max(1,stride(A, 2)))
13201319
A
13211320
end
13221321
end
@@ -1342,11 +1341,11 @@ for (fname, elty, relty) in ((:zher_,:ComplexF64, :Float64),
13421341
if length(x) != n
13431342
throw(DimensionMismatch("A has size ($n,$n), x has length $(length(x))"))
13441343
end
1345-
ccall((@blasfunc($fname), libblastrampoline), Cvoid,
1344+
px, stx = ptrst1(x)
1345+
GC.@preserve x ccall((@blasfunc($fname), libblastrampoline), Cvoid,
13461346
(Ref{UInt8}, Ref{BlasInt}, Ref{$relty}, Ptr{$elty},
13471347
Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}, Clong),
1348-
uplo, n, α, x,
1349-
stride(x, 1), A, max(1,stride(A,2)), 1)
1348+
uplo, n, α, px, stx, A, max(1,stride(A,2)), 1)
13501349
A
13511350
end
13521351
end

stdlib/LinearAlgebra/test/blas.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ Random.seed!(100)
125125
@test_throws DimensionMismatch BLAS.trsv('U','N','N',A,Vector{elty}(undef,n+1))
126126
end
127127
end
128-
@testset "ger, her, syr" for x in (rand(elty, n), view(rand(elty,2n), 1:2:2n)),
129-
y in (rand(elty,n), view(rand(elty,3n), 1:3:3n))
128+
@testset "ger, her, syr" for x in (rand(elty, n), view(rand(elty,2n), 1:2:2n), view(rand(elty,2n), 2n:-2:1)),
129+
y in (rand(elty,n), view(rand(elty,3n), 1:3:3n), view(rand(elty,3n), 3n:-3:1))
130130

131131
A = rand(elty,n,n)
132132
α = rand(elty)

0 commit comments

Comments
 (0)