Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

hanliutong
Copy link
Contributor

@hanliutong hanliutong commented Aug 8, 2022

This is a patch of my GSoC project that the goal is to make the existing Universal Intrinsic compatible with scalable (variable-length) backends.

In #22179, we have already introduce a new framework of universal intrinsic for RISC-V Vector backend and few implementations and test cases are also added.

In this patch, we are going to add more universal intrinsic implementations for RVV.

Tested with QEMU for RVV backend in various VLEN:

qemu-riscv64 -cpu rv64,x-v=true,vlen=128 ./bin/opencv_test_core --gtest_filter="hal*"
qemu-riscv64 -cpu rv64,x-v=true,vlen=512 ./bin/opencv_test_core --gtest_filter="hal*"

Also tested for AVX and SSE backend on Linux.

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

@hanliutong
Copy link
Contributor Author

hanliutong commented Aug 14, 2022

Update:

  1. There are some differences between the implementation and the documentation, the following test case is modified to match the documentation description:
  • v_min v_max for v_uint64 and v_int64 are removed.
  • test_abs for v_float32 and v_float64 are enabled.
  1. Since we introduce some new intrinsic functions, testcase for v_mul(v0,v1, ..., vn) and v_add(v0,v1, ..., vn) are added (in test_mul() and test_addsub()).

And we may also need to update the documentations: test_mul_expand is enabled for v_unit8 and v_int8, but the doc said it is only for 16- and unsigned 32-bit source types

@hanliutong
Copy link
Contributor Author

Hello @vpisarev, I have added some implementations as discussed in our meeting today (zip, transpose and interleave), there are also 2 sets of functions submitted together (combine and reverse).

And this PR is frozen for review, any new implementations will commit to another new PR.

@vpisarev vpisarev self-requested a review August 18, 2022 12:20
@vpisarev
Copy link
Contributor

looks good to me. @asmorkalov, since it's very unobtrusive patch, I suggest to merge it

@asmorkalov
Copy link
Contributor

👍 Tested manually with Qemu!

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.

3 participants