Fix RVV toolchain conflicts.#20182
Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom May 31, 2021
Merged
Conversation
Contributor
|
nice solution! 👍 |
Merged
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.
Thanks to @damonyu1989 for bringing us a parallel implementations based on RVV 0.7.1 with pr #19778. However, there is a minor bug that causes conflicts with the existing toolchain.
In cv_cpu_dispatch.h,
CV_RVV071will be defined when__riscv,__riscv_vectorare defined, which are compiler preset macros. This will cause conflicts because any compiler that supports RVV will generate these two macros, not specific to RVV 0.7.1. This means that when you try to compile OpenCV using the toolchain base on the latest RVV draft of the standard, you will incorrectly define the macroCV_RVV071and try to reference a header file(riscv-vector.h) that does not exist (renamedriscv_vector.h), which will cause the compilation to fail.Therefore, I added a preset macro in cmake to solve the problem.
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.