Skip to content

Conversation

@dkarrasch
Copy link
Member

This allows generic matmul to work with types that don't have a defined zero, but for which zero is defined on values. This avoids some trivial multiplications, and therefore contains a speed-up in generic syrk. I'm not sure if I was seeing slight performance drops in very small matrix cases, but AFAICT these code branches are not affected by the changes.

Fixes #1486.

@dkarrasch dkarrasch requested review from araujoms and jishnub and removed request for jishnub November 24, 2025 13:12
@araujoms
Copy link
Collaborator

I'm confused. I thought you wanted multiplication of empty matrices to fail, but it is just return a zero matrix of the appropriate size?

@dkarrasch
Copy link
Member Author

No, I didn't want it to fail. And it has been working at least since v1.0. The only issue is that for empty matrices and a return eltype that doesn't have a zero (only for given elements), we can't fill the returned array with zeros. That's the throwing test.

@dkarrasch dkarrasch merged commit 6beb32c into master Nov 26, 2025
1 of 2 checks passed
@dkarrasch dkarrasch deleted the dk/matmulmod branch November 26, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

* on matrices of custom number types used to work in Julia <=1.10 and does not anymore (now requires zero to be defined and maybe shouldn't)

3 participants