mirror of
https://github.com/opencv/opencv.git
synced 2025-06-19 00:46:39 +08:00
test(hal): properly dispatch FP16 test
This commit is contained in:
parent
76f7fb5231
commit
b18983a005
@ -1,10 +1,17 @@
|
|||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "test_intrin_utils.hpp"
|
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
|
||||||
|
#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;
|
using namespace cv;
|
||||||
|
|
||||||
namespace cvtest { namespace hal {
|
namespace cvtest { namespace hal {
|
||||||
|
using namespace CV_CPU_OPTIMIZATION_NAMESPACE;
|
||||||
|
|
||||||
//============= 8-bit integer =====================================================================
|
//============= 8-bit integer =====================================================================
|
||||||
|
|
||||||
@ -220,4 +227,10 @@ TEST(hal_intrin, float64x2) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
TEST(hal_intrin,float16x4)
|
||||||
|
{
|
||||||
|
CV_CPU_CALL_FP16(test_hal_intrin_float16x4, ());
|
||||||
|
throw SkipTestException("Unsupported hardware: FP16 is not available");
|
||||||
|
}
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
@ -2,10 +2,15 @@
|
|||||||
#include "test_intrin_utils.hpp"
|
#include "test_intrin_utils.hpp"
|
||||||
|
|
||||||
namespace cvtest { namespace hal {
|
namespace cvtest { namespace hal {
|
||||||
TEST(hal_intrin, float16x4) {
|
CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
|
||||||
|
|
||||||
|
void test_hal_intrin_float16x4()
|
||||||
|
{
|
||||||
TheTest<v_float16x4>()
|
TheTest<v_float16x4>()
|
||||||
.test_loadstore_fp16()
|
.test_loadstore_fp16()
|
||||||
.test_float_cvt_fp16()
|
.test_float_cvt_fp16()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}}
|
|
||||||
|
CV_CPU_OPTIMIZATION_NAMESPACE_END
|
||||||
|
}} // namespace
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#ifndef _TEST_UTILS_HPP_
|
|
||||||
#define _TEST_UTILS_HPP_
|
|
||||||
|
|
||||||
#include "opencv2/core/hal/intrin.hpp"
|
#include "opencv2/core/hal/intrin.hpp"
|
||||||
#include "opencv2/ts.hpp"
|
|
||||||
#include <ostream>
|
namespace cvtest { namespace hal {
|
||||||
#include <algorithm>
|
CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
|
||||||
#include <climits>
|
|
||||||
|
void test_hal_intrin_float16x4();
|
||||||
|
|
||||||
|
#ifndef CV_CPU_OPTIMIZATION_DECLARATIONS_ONLY
|
||||||
|
|
||||||
template <typename R> struct Data;
|
template <typename R> struct Data;
|
||||||
template <int N> struct initializer;
|
template <int N> struct initializer;
|
||||||
@ -156,8 +156,6 @@ template <typename R> std::ostream & operator<<(std::ostream & out, const Data<R
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace cvtest { namespace hal {
|
|
||||||
|
|
||||||
template<typename T> static inline void EXPECT_COMPARE_EQ_(const T a, const T b);
|
template<typename T> static inline void EXPECT_COMPARE_EQ_(const T a, const T b);
|
||||||
template<> inline void EXPECT_COMPARE_EQ_<float>(const float a, const float b)
|
template<> inline void EXPECT_COMPARE_EQ_<float>(const float a, const float b)
|
||||||
{
|
{
|
||||||
@ -962,7 +960,8 @@ template<typename R> struct TheTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
CV_CPU_OPTIMIZATION_NAMESPACE_END
|
||||||
|
}} // namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user