Skip to content
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

BUGFIX: genmatmul! for empty input matrices #33874

Merged
merged 2 commits into from
Nov 19, 2019
Merged

BUGFIX: genmatmul! for empty input matrices #33874

merged 2 commits into from
Nov 19, 2019

Conversation

KlausC
Copy link
Contributor

@KlausC KlausC commented Nov 17, 2019

fix #33873

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