-
-
Notifications
You must be signed in to change notification settings - Fork 37
Speicalize copy! for triangular, and use copy! in ldiv
#1263
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1263 +/- ##
==========================================
- Coverage 92.03% 91.97% -0.07%
==========================================
Files 34 34
Lines 15475 15479 +4
==========================================
- Hits 14243 14237 -6
- Misses 1232 1242 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Gentle bump |
dkarrasch
left a comment
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.
SGTM
I haven't looked into the copy! and copyto! dispatch in a while and don't have the bandwidth to do that now, but this either doesn't change anything (like renaming or being led to the same implementation by multiple dispatch), or improves ttfx and/or runtime, right?
|
Yes, I think this should be a harmless change |
Currently, we specialize
copyto!for a triangular source. However, this has two branches, depending on whether the axes match. In the branch where the axes do match, we may usecopy!instead, and specialize this in terms of the internal_copyto!which is identical in implementation.We also use
copy!inldivinstead ofcopyto!. These should be equivalent in most cases, barring one extra axes check incopy!, as the fallback method forcopy!callscopyto!internally. However, the advantage comes for triangular matrices, wherecopy!doesn't have branches, as the axes necessarily match.As a consequence, this reduces the TTFX in operations like
I've renamed the internal functions as
_copyto!->_copy!andcopyto_unaliased!->copy_unaliased!, as these are closer to the meaning ofcopy!than tocopyto!.