Unroll multiply and add instructions in dotProd_32f#15136
Merged
alalek merged 2 commits intoopencv:3.4from Jul 25, 2019
ChipKerchner:dotProd_unroll
Merged
Unroll multiply and add instructions in dotProd_32f#15136alalek merged 2 commits intoopencv:3.4from ChipKerchner:dotProd_unroll
alalek merged 2 commits intoopencv:3.4from
ChipKerchner:dotProd_unroll
Conversation
Member
|
@terfendail Could you collect performance changes on IA? |
tomoaki0705
reviewed
Jul 24, 2019
modules/core/src/matmul.simd.hpp
Outdated
| vx_load(src2 + j + (cWidth * 3)), v_sum3); | ||
| } | ||
|
|
||
| r += v_reduce_sum(v_sum1) + v_reduce_sum(v_sum2) + v_reduce_sum(v_sum3); |
Contributor
There was a problem hiding this comment.
v_reduce_sum is not really fast especially if the HW doesn't have a horizontal sum up instruction.
It's better to reduce the number of call to v_reduce_sum
r += v_reduce_sum(v_sum1 + v_sum2 + v_sum3)
Member
There was a problem hiding this comment.
I believe we can eliminate v_reduce_sum() call from here completely:
v_sum += v_sum1 + v_sum2 + v_sum3;
alalek
approved these changes
Jul 25, 2019
Merged
Contributor
|
[58/1943]
Performance for SSE2 baseline
[34/1943]
Performance for SSE3 baseline
[10/1943]
Performance for SSE4_2 baseline
Performance for AVX2 baseline
|
dvd42
pushed a commit
to dvd42/opencv
that referenced
this pull request
Aug 6, 2019
* Unroll multiply and add instructions in dotProd_32f - 35% faster. * Eliminate unnecessary v_reduce_sum instructions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unroll multiply and add instructions (absorb latencies) into separate accumulators in dotProd_32f - 35% faster.