opencv/hal/riscv-rvv/rvv_hal.hpp
Yuantao Feng 547cef4e88
Merge pull request #27301 from fengyuentau:4x/hal/riscv_rvv/refactor_build
hal/riscv-rvv: refactor the building process #27301

Current hal/riscv-rvv is built with all headers without building an object. This slows down the compilation progress, especially when re-compiling for minor changes in those headers (~170 files need to be re-compiled). This patch solves the problem.

### 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
- [ ] 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
2025-05-14 14:04:58 +03:00

32 lines
934 B
C++

// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#ifndef OPENCV_HAL_RVV_HPP_INCLUDED
#define OPENCV_HAL_RVV_HPP_INCLUDED
#include "opencv2/core/base.hpp"
#include "opencv2/core/utility.hpp"
#include "opencv2/core/hal/interface.h"
#if defined(__riscv_v) && __riscv_v == 1000000
#define CV_HAL_RVV_1P0_ENABLED 1
#else
#define CV_HAL_RVV_1P0_ENABLED 0
#endif
#if defined(__riscv_v) && __riscv_v == 7000 && defined(__GNUC__) && __GNUC__ == 10 && __GNUC_MINOR__ == 4 && defined(__THEAD_VERSION__)
#define CV_HAL_RVV_071_ENABLED 1
#else
#define CV_HAL_RVV_071_ENABLED 0
#endif
#if CV_HAL_RVV_1P0_ENABLED || CV_HAL_RVV_071_ENABLED
#include <riscv_vector.h>
#endif
#include "include/types.hpp"
#include "include/core.hpp"
#include "include/imgproc.hpp"
#endif // OPENCV_HAL_RVV_HPP_INCLUDED