From 5462a6be6e870b4a894592207921db2c9495f17c Mon Sep 17 00:00:00 2001 From: HAN Liutong Date: Wed, 26 Oct 2022 13:02:03 +0000 Subject: [PATCH] Update SIMD macro for RVV backend. --- modules/core/include/opencv2/core/hal/intrin.hpp | 9 +++++---- .../include/opencv2/core/hal/intrin_rvv_scalable.hpp | 8 +++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/core/include/opencv2/core/hal/intrin.hpp b/modules/core/include/opencv2/core/hal/intrin.hpp index c12140bbf8..4239a7e229 100644 --- a/modules/core/include/opencv2/core/hal/intrin.hpp +++ b/modules/core/include/opencv2/core/hal/intrin.hpp @@ -522,6 +522,11 @@ using namespace CV__SIMD_NAMESPACE; #endif +//! @cond IGNORED +#ifndef CV_SIMD_64F +#define CV_SIMD_64F 0 +#endif + namespace CV__SIMD_NAMESPACE { //! @addtogroup core_hal_intrin //! @{ @@ -886,10 +891,6 @@ namespace CV__SIMD_NAMESPACE { #undef VXPREFIX } // namespace -//! @cond IGNORED -#ifndef CV_SIMD_64F -#define CV_SIMD_64F 0 -#endif #ifndef CV_SIMD_FP16 #define CV_SIMD_FP16 0 //!< Defined to 1 on native support of operations with float16x8_t / float16x16_t (SIMD256) types diff --git a/modules/core/include/opencv2/core/hal/intrin_rvv_scalable.hpp b/modules/core/include/opencv2/core/hal/intrin_rvv_scalable.hpp index 463c010d71..5dd9e2cda7 100644 --- a/modules/core/include/opencv2/core/hal/intrin_rvv_scalable.hpp +++ b/modules/core/include/opencv2/core/hal/intrin_rvv_scalable.hpp @@ -1,3 +1,9 @@ +// 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. + +// The original implementation is contributed by HAN Liutong. +// Copyright (C) 2022, Institute of Software, Chinese Academy of Sciences. #ifndef OPENCV_HAL_INTRIN_RVV_SCALABLE_HPP #define OPENCV_HAL_INTRIN_RVV_SCALABLE_HPP @@ -1689,7 +1695,7 @@ OPENCV_HAL_IMPL_RVV_PACK_TRIPLETS(v_float64, vlmul_trunc_u8mf8) ////// FP16 support /////// -#if __riscv_zfh +#if defined(__riscv_zfh) && __riscv_zfh inline v_float32 v_load_expand(const float16_t* ptr) { return vfwcvt_f(vle16_v_f16mf2((_Float16*)ptr, VTraits::vlanes()) ,VTraits::vlanes());;