From 5c3880d302220d95a0d9a87dfaceeffe44eeb568 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 6 Aug 2018 19:25:18 +0000 Subject: [PATCH] core(intrin): avoid symbols duplication from SIMD128/256 cases All vx_call() must be wrapped into own simd128/simd256/simd512 namespace ``` namespace CV__SIMD_NAMESPACE { ... vx_call declaration is here ... } ``` --- modules/core/include/opencv2/core/hal/intrin.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/core/include/opencv2/core/hal/intrin.hpp b/modules/core/include/opencv2/core/hal/intrin.hpp index 31504a6291..ff2d5160d2 100644 --- a/modules/core/include/opencv2/core/hal/intrin.hpp +++ b/modules/core/include/opencv2/core/hal/intrin.hpp @@ -296,11 +296,17 @@ template struct V_RegTraits #endif #if CV_SIMD512 && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 512) +#define CV__SIMD_NAMESPACE simd512 +namespace CV__SIMD_NAMESPACE { #define CV_SIMD 1 #define CV_SIMD_64F CV_SIMD512_64F #define CV_SIMD_WIDTH 64 // TODO typedef v_uint8 / v_int32 / etc types here +} // namespace +using namespace CV__SIMD_NAMESPACE; #elif CV_SIMD256 && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 256) +#define CV__SIMD_NAMESPACE simd256 +namespace CV__SIMD_NAMESPACE { #define CV_SIMD 1 #define CV_SIMD_64F CV_SIMD256_64F #define CV_SIMD_WIDTH 32 @@ -323,7 +329,11 @@ template struct V_RegTraits CV_INTRIN_DEFINE_WIDE_INTRIN_ALL_TYPES(v256) CV_INTRIN_DEFINE_WIDE_INTRIN(double, v_float64, f64, v256, load) inline void vx_cleanup() { v256_cleanup(); } +} // namespace +using namespace CV__SIMD_NAMESPACE; #elif (CV_SIMD128 || CV_SIMD128_CPP) && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 128) +#define CV__SIMD_NAMESPACE simd128 +namespace CV__SIMD_NAMESPACE { #define CV_SIMD CV_SIMD128 #define CV_SIMD_64F CV_SIMD128_64F #define CV_SIMD_WIDTH 16 @@ -348,6 +358,8 @@ template struct V_RegTraits CV_INTRIN_DEFINE_WIDE_INTRIN(double, v_float64, f64, v, load) #endif inline void vx_cleanup() { v_cleanup(); } +} // namespace +using namespace CV__SIMD_NAMESPACE; #endif inline unsigned int trailingZeros32(unsigned int value) {