Skip to content

Conversation

@KlausC
Copy link
Contributor

@KlausC KlausC commented Nov 17, 2019

fix JuliaLang/LinearAlgebra.jl#682

Note: This regression was introduced in #33530 .

@dkarrasch dkarrasch added the linear algebra Linear algebra label Nov 18, 2019
@KlausC KlausC changed the title correct genmatmul! for empty input matrices BUGFIX: genmatmul! for empty input matrices Nov 18, 2019
@andreasnoack andreasnoack added the bugfix This change fixes an existing bug label Nov 19, 2019
@andreasnoack
Copy link
Member

Why don't we just call _rmul_or_fill!(C, _add.beta) unconditionally. I believe that is essentially the BLAS behavior which ensures proper initialization of C.

@KlausC
Copy link
Contributor Author

KlausC commented Nov 19, 2019

@andreasnoack, I think, because the initialization is only required in the return case.
The rest of the code (when the multiplication actually happens) initializes C by itself. Actually I did not think to change that, because I was focused on removing the bug. Maybe it is worth a separate PR to optimize the code.

@andreasnoack
Copy link
Member

I see. In BLAS the β part is handled separately before the multiplication but I now see how it's handled differently here. I think this fix is good to go since the test failures are unrelated.

@andreasnoack andreasnoack merged commit e5ee8da into JuliaLang:master Nov 19, 2019
KristofferC pushed a commit that referenced this pull request Apr 11, 2020
* correct genmatmul! for empty input matrices

* tests for getmatmul!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This change fixes an existing bug linear algebra Linear algebra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cornercase bug in LinearAlgebra.genmatmul!

3 participants