-
-
Notifications
You must be signed in to change notification settings - Fork 852
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
Add AVX2 version of CollectHistogram #1882
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1882 +/- ##
======================================
Coverage 87% 87%
======================================
Files 959 959
Lines 50392 50402 +10
Branches 6258 6260 +2
======================================
+ Hits 44113 44122 +9
Misses 5246 5246
- Partials 1033 1034 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
int clippedValue = ClipMax(v, MaxCoeffThresh); | ||
++this.distribution[clippedValue]; | ||
// Load. | ||
ref short outputRef = ref MemoryMarshal.GetReference<short>(this.output); |
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.
ref short outputRef = ref MemoryMarshal.GetReference<short>(this.output); | |
ref short outputRef = ref MemoryMarshal.GetArrayDataReference(this.output); |
Avoids the intermediate array -> Span
step.
But this API is only available from .NET 5 onwards 😢
So maybe just leave the code as is, and remember this API for other uses 😉
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.
We should definitely start using this once we get rid of supporting the older frameworks
Prerequisites
Description
This PR adds a AVX2 version of CollectHistogram, which is used during lossy webp encoding.
Related to #1786
Profiling results:
master
PR