Skip to content

Compile-time check for zero alpha in matmul #1293

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

Merged
merged 3 commits into from
Apr 22, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Tests for zero alpha in bidiag matmul
  • Loading branch information
jishnub committed Apr 18, 2025
commit 705c9b0ecfcce8734ac51a1f03a709e0bd81ed86
4 changes: 4 additions & 0 deletions test/bidiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,9 @@ end
@test A * D ≈ mul!(S, A, D) ≈ M * D
@test D * A ≈ mul!(S, D, A) ≈ D * M
@test mul!(copy(S), D, A, 2, 2) ≈ D * M * 2 + S * 2
@test mul!(copy(S), D, A, 0, 2) ≈ D * M * 0 + S * 2
@test mul!(copy(S), A, D, 2, 2) ≈ M * D * 2 + S * 2
@test mul!(copy(S), A, D, 0, 2) ≈ M * D * 0 + S * 2

A2 = Bidiagonal(dv, zero(ev), uplo)
M2 = Array(A2)
Expand Down Expand Up @@ -1074,10 +1076,12 @@ end
@test B * v ≈ M * v
@test mul!(similar(v), B, v) ≈ M * v
@test mul!(ones(size(v)), B, v, 2, 3) ≈ M * v * 2 .+ 3
@test mul!(ones(size(v)), B, v, 0, 3) ≈ M * v * 0 .+ 3

@test B * B ≈ M * M
@test mul!(similar(B, size(B)), B, B) ≈ M * M
@test mul!(ones(size(B)), B, B, 2, 4) ≈ M * M * 2 .+ 4
@test mul!(ones(size(B)), B, B, 0, 4) ≈ M * M * 0 .+ 4

for m in 0:6
AL = rand(m,n)
Expand Down