-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix: Complex SubArray times real Matrix #29246
Fix: Complex SubArray times real Matrix #29246
Conversation
@testset "Combination $T1 $T2 $arg1_real $arg2_real" for arg2_real in (true,false) | ||
A0 = reshape(Vector{T1}(1:25),5,5) .+ | ||
(arg1_real ? 0 : 1im*reshape(Vector{T1}(-3:21),5,5)) | ||
A = view(A0,1:2,1:2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also add a test with view(A0,:,1:2)
to test the code path that dispatches to BLAS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, would you mind making the same change in the two other places where we use the reinterpret
trick?
Sure. For the record: This leads to another situation the trick is used and it also does not work:
|
Done. All three reinterpret tricks are now changed. |
* gemm_wrapper! -> mul! (#29224) * testing for #29224 * code review update: More tests * Complex times real reinterpret trick fix for vectors and transposed matrices (cherry picked from commit 82503cd)
* gemm_wrapper! -> mul! (#29224) * testing for #29224 * code review update: More tests * Complex times real reinterpret trick fix for vectors and transposed matrices (cherry picked from commit 82503cd)
* gemm_wrapper! -> mul! (#29224) * testing for #29224 * code review update: More tests * Complex times real reinterpret trick fix for vectors and transposed matrices (cherry picked from commit 82503cd)
This fixes JuliaLang/LinearAlgebra.jl#566 concerning multiplication of a complex SubArray with a real matrix. The only substantial change is
to
This allows dispatch to determine if we can use
gemm
for the reinterpreted matrix, or just do it through the fallbackgeneric_matmatmul!
.