Skip to content

Commit

Permalink
Add (broken) tests for allocation in 5-arg mul!()
Browse files Browse the repository at this point in the history
See JuliaLang#47206 for a fix proposal.
  • Loading branch information
amilsted authored Mar 31, 2023
1 parent 8b19f5f commit 87d74c9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions stdlib/LinearAlgebra/test/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -978,5 +978,18 @@ end
@test *(a, b, c, 99.9) (a * b) * (c * 99.9)
end
end

@testset "Issue #46865: mul!() with non-const alpha, beta" begin
f!(C,A,B,alphas,betas) = mul!(C, A, B, alphas[1], betas[1])
alphas = [1.0]
betas = [0.5]
for d in [2,3,4] # test native small-matrix cases as well as BLAS
A = rand(d,d)
B = copy(A)
C = copy(A)
f!(C, A, B, alphas, betas)
@test_broken (@allocated f!(C, A, B, alphas, betas)) == 0
end
end

end # module TestMatmul

0 comments on commit 87d74c9

Please sign in to comment.