added in-place support for cartToPolar and polarToCart#24893
Merged
asmorkalov merged 5 commits intoopencv:4.xfrom Mar 26, 2024
Merged
added in-place support for cartToPolar and polarToCart#24893asmorkalov merged 5 commits intoopencv:4.xfrom
asmorkalov merged 5 commits intoopencv:4.xfrom
Conversation
a fused hal::cartToPolar[32|64]f() is used instead of sequential hal::magnitude[32|64]f/hal::fastAtan[32|64]f ipp_polarToCart is skipped when in-place (it seems not to support it correctly)
Contributor
|
This is not so easy, because in-place is expected by be faster than regular src->dst call. At least not slower. Current gaps are:
BTW, see also #7819 - this is my attempt but it was incomplete too. |
Contributor
Author
I don't think there is a risk of perf regression because
Interesting (currently on my host machine the test_arithm does not raise any error), do you think that it is related to the ReadOnly/WriteOnly/ReadWrite specification of kernel arguments that would let the compiler assume some |
I lack a test case where in-place would fail due to some run time implementations (as reported by a previosu comment) This proposal aims at expliciting that some buffers can be in/out, so that no optimization would trick the memory accesses
refactored CartPolar to test more cases this revealed a bug in the original implementation of polarToCart with implicit magnitude in 64F case
Contributor
|
@opencv-alalek @mshabunin @vpisarev could you take a look? |
Contributor
vpisarev
approved these changes
Mar 7, 2024
Contributor
|
@vpisarev @opencv-alalek is it ready for merge? |
Merged
klatism
pushed a commit
to klatism/opencv
that referenced
this pull request
May 17, 2024
Added in-place support for cartToPolar and polarToCart opencv#24893 - a fused hal::cartToPolar[32|64]f() is used instead of sequential hal::magnitude[32|64]f/hal::fastAtan[32|64]f - ipp_polarToCart is skipped for in-place processing (it seems not to support it correctly) relates to opencv#24891 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [X] I agree to contribute to the project under Apache 2 License. - [X] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [X] The PR is proposed to the proper branch - [X] There is a reference to the original bug report and related work - [X] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
savuor
pushed a commit
to savuor/opencv
that referenced
this pull request
Nov 8, 2024
Added in-place support for cartToPolar and polarToCart opencv#24893 - a fused hal::cartToPolar[32|64]f() is used instead of sequential hal::magnitude[32|64]f/hal::fastAtan[32|64]f - ipp_polarToCart is skipped for in-place processing (it seems not to support it correctly) relates to opencv#24891 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [X] I agree to contribute to the project under Apache 2 License. - [X] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [X] The PR is proposed to the proper branch - [X] There is a reference to the original bug report and related work - [X] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
savuor
pushed a commit
to savuor/opencv
that referenced
this pull request
Nov 21, 2024
Added in-place support for cartToPolar and polarToCart opencv#24893 - a fused hal::cartToPolar[32|64]f() is used instead of sequential hal::magnitude[32|64]f/hal::fastAtan[32|64]f - ipp_polarToCart is skipped for in-place processing (it seems not to support it correctly) relates to opencv#24891 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [X] I agree to contribute to the project under Apache 2 License. - [X] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [X] The PR is proposed to the proper branch - [X] There is a reference to the original bug report and related work - [X] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
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.
relates to #24891
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.