Skip to content

Add test cases and fix bugs in the RISC-V Vector HAL.#26675

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
hanliutong:rvv-hal-fix
Dec 29, 2024
Merged

Add test cases and fix bugs in the RISC-V Vector HAL.#26675
asmorkalov merged 1 commit intoopencv:4.xfrom
hanliutong:rvv-hal-fix

Conversation

@hanliutong
Copy link
Copy Markdown
Contributor

We are in the process of adding more specific optimization functions to the RVV HAL, meanwhile, we took a look back and fixed some bugs in mean and merge:

  • [merge] Fix stride mismatch in vector store segment instructions, and add tests for it.
    We previously only considered the cn is 2,3,4, and it is actually wrong when cn>4 (this patch also adds vectorization for the part where cn>4)
# The following are the newly added tests that have been fixed
[==========] 32 tests from 1 test case ran. (4 ms total)
[  PASSED  ] 24 tests.
[  FAILED  ] 8 tests, listed below:
[  FAILED  ] Core_Mat_arrays.SplitMerge/16, where GetParam() = (5, 8UC1)
[  FAILED  ] Core_Mat_arrays.SplitMerge/17, where GetParam() = (5, 16UC1)
[  FAILED  ] Core_Mat_arrays.SplitMerge/20, where GetParam() = (6, 8UC1)
[  FAILED  ] Core_Mat_arrays.SplitMerge/21, where GetParam() = (6, 16UC1)
[  FAILED  ] Core_Mat_arrays.SplitMerge/24, where GetParam() = (7, 8UC1)
[  FAILED  ] Core_Mat_arrays.SplitMerge/25, where GetParam() = (7, 16UC1)
[  FAILED  ] Core_Mat_arrays.SplitMerge/28, where GetParam() = (8, 8UC1)
[  FAILED  ] Core_Mat_arrays.SplitMerge/29, where GetParam() = (8, 16UC1)
  • [merge] Use static instead of inline to suppress some warnings.
  • [mean] Fix wrong number of elements in 8UC4 with mask: nz should obviously be divided by 4 at the end, not in the loop.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • 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
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • 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

@asmorkalov asmorkalov merged commit 9c33bae into opencv:4.x Dec 29, 2024
@asmorkalov asmorkalov mentioned this pull request Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants