diff --git a/modules/core/test/test_intrin.cpp b/modules/core/test/test_intrin.cpp index e055edd9f0..09cf196c30 100644 --- a/modules/core/test/test_intrin.cpp +++ b/modules/core/test/test_intrin.cpp @@ -1,10 +1,17 @@ #include "test_precomp.hpp" -#include "test_intrin_utils.hpp" #include +#include "test_intrin_utils.hpp" + +#define CV_CPU_SIMD_FILENAME "test_intrin_utils.hpp" +#define CV_CPU_DISPATCH_MODE FP16 +#include "opencv2/core/private/cv_cpu_include_simd_declarations.hpp" + + using namespace cv; namespace cvtest { namespace hal { +using namespace CV_CPU_OPTIMIZATION_NAMESPACE; //============= 8-bit integer ===================================================================== @@ -220,4 +227,10 @@ TEST(hal_intrin, float64x2) { } #endif +TEST(hal_intrin,float16x4) +{ + CV_CPU_CALL_FP16(test_hal_intrin_float16x4, ()); + throw SkipTestException("Unsupported hardware: FP16 is not available"); +} + }} diff --git a/modules/core/test/test_intrin.fp16.cpp b/modules/core/test/test_intrin.fp16.cpp index 4f277642ec..5e7e49a49c 100644 --- a/modules/core/test/test_intrin.fp16.cpp +++ b/modules/core/test/test_intrin.fp16.cpp @@ -2,10 +2,15 @@ #include "test_intrin_utils.hpp" namespace cvtest { namespace hal { -TEST(hal_intrin, float16x4) { +CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN + +void test_hal_intrin_float16x4() +{ TheTest() .test_loadstore_fp16() .test_float_cvt_fp16() ; } -}} + +CV_CPU_OPTIMIZATION_NAMESPACE_END +}} // namespace diff --git a/modules/core/test/test_intrin_utils.hpp b/modules/core/test/test_intrin_utils.hpp index 817dad798c..c4e74fa1e1 100644 --- a/modules/core/test/test_intrin_utils.hpp +++ b/modules/core/test/test_intrin_utils.hpp @@ -1,11 +1,11 @@ -#ifndef _TEST_UTILS_HPP_ -#define _TEST_UTILS_HPP_ - #include "opencv2/core/hal/intrin.hpp" -#include "opencv2/ts.hpp" -#include -#include -#include + +namespace cvtest { namespace hal { +CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN + +void test_hal_intrin_float16x4(); + +#ifndef CV_CPU_OPTIMIZATION_DECLARATIONS_ONLY template struct Data; template struct initializer; @@ -156,8 +156,6 @@ template std::ostream & operator<<(std::ostream & out, const Data static inline void EXPECT_COMPARE_EQ_(const T a, const T b); template<> inline void EXPECT_COMPARE_EQ_(const float a, const float b) { @@ -962,7 +960,8 @@ template struct TheTest } }; - } -} #endif + +CV_CPU_OPTIMIZATION_NAMESPACE_END +}} // namespace