Universal intrinsics implementation with RISC-V vector extension#18228
Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom Dec 2, 2020
Merged
Universal intrinsics implementation with RISC-V vector extension#18228opencv-pushbot merged 1 commit intoopencv:masterfrom
opencv-pushbot merged 1 commit intoopencv:masterfrom
Conversation
asmorkalov
requested changes
Sep 2, 2020
Contributor
There was a problem hiding this comment.
/home/alexander/Projects/riscv/opencv/modules/core/test/test_intrin_utils.hpp:337:46: error: no matching function for call to 'v_reinterpret_as_f32(cv::hal_baseline::v_float64x2&)'
337 | v_float32 vf32 = v_reinterpret_as_f32(r1); out.a.clear(); v_store((float*)out.a.d, vf32); EXPECT_EQ(data.a, out.a);
| ~~~~~~~~~~~~~~~~~~~~^~~~
|
|
||
| v_uint8x16() {} | ||
| explicit v_uint8x16(vuint8m1_t v) : val(v) {} | ||
| v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7, |
Contributor
There was a problem hiding this comment.
Copy constructor and operator= required for build for all v_int, v_uint, v_float, etc structures.
Contributor
|
Contributor
|
bbc991b to
a39a21c
Compare
Contributor
|
👍 |
Contributor
|
@asmorkalov, you requested some changes. Are you happy with what has been done. I tested this PR and from side I do not see any showstoppers, except for the two:
|
9a0bb08 to
d41c61a
Compare
Contributor
Author
|
Hi dear @asmorkalov and @vpisarev , I reverted some unnessesary commits before squash. I tested the current version and it works as well as before. Even so, I recommend that you test it again before merging to make sure there are no problems. |
6 tasks
Merged
6 tasks
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.
This PR From GSoC Project "Optimize OpenCV for RISC-V"
Project introduction
The main objective of the project is adding implementation of OpenCV wide universal intrinsics for RISC-V vector in OpenCV Hardware Acceleration Layer (HAL).
This PR is now working in progress.
Two previous PRs related to the project
Following two previous PRs mainly provided the toolchain files for cross-compiling OpenCV with target riscv64 on Linux platform. The first PR is with Clang and the second is with riscv-gnu-toolchain.
#17922
#18227
Main contents of my work
Added toolchain file for target
riscv64-clang.Added toolchain file for target
riscv64-gcc.Added universal intrinsics implementation with RISC-V vector extension.
Added some native intrinsics in C++ that are unsupported by compiler temporarily.
Current progress
Universal intrinsics implementation with RISC-V vector extension is almost done. But the way universal intrinsic vector types are declared right now needs some changes. See the following issue for specific reasons.
riscv-collab/riscv-gnu-toolchain#701
Use empty functions instead of missing native intrinsics temporarily.
Near future work
Change the universal intrinsic vector types with in-memory vectors and add extra loads/stores to get functional code.
Implement missing native intrinsics in C++ which are now still empty functions.
Long future work
Performance improvements. Maybe the current universal intrinsic framework need some change to fit scalable vector architecture.
RISC-V vector extension and rvv-intrinsics are still in the process of development. The compiler support is not completely ready at present and there may be changes in riscv-v-spec and rvv-intrinsics in the future. Therefore, this implementation needs to be maintained continuously according to the development of RISC-V.
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.