add universal hardware support check function
* use hasSIMD128 rather than calling checkHardwareSupport * add SIMD check in spartialgradient.cpp * add SIMD check in stereosgbm.cpp * add SIMD check in canny.cpp
This commit is contained in:
@@ -1772,6 +1772,17 @@ inline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0,
|
||||
|
||||
//! @}
|
||||
|
||||
//! @name Check SIMD support
|
||||
//! @{
|
||||
//! @brief Check CPU capability of SIMD operation
|
||||
static inline bool hasSIMD128()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#define OPENCV_HAL_INTRIN_NEON_HPP
|
||||
|
||||
#include <algorithm>
|
||||
#include "opencv2/core/utility.hpp"
|
||||
|
||||
namespace cv
|
||||
{
|
||||
@@ -1218,6 +1219,16 @@ inline v_float16x4 v_cvt_f16(const v_float32x4& a)
|
||||
}
|
||||
#endif
|
||||
|
||||
//! @name Check SIMD support
|
||||
//! @{
|
||||
//! @brief Check CPU capability of SIMD operation
|
||||
static inline bool hasSIMD128()
|
||||
{
|
||||
return checkHardwareSupport(CV_CPU_NEON);
|
||||
}
|
||||
|
||||
//! @}
|
||||
|
||||
//! @endcond
|
||||
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#define OPENCV_HAL_SSE_HPP
|
||||
|
||||
#include <algorithm>
|
||||
#include "opencv2/core/utility.hpp"
|
||||
|
||||
#define CV_SIMD128 1
|
||||
#define CV_SIMD128_64F 1
|
||||
@@ -1726,6 +1727,16 @@ inline v_float16x4 v_cvt_f16(const v_float32x4& a)
|
||||
}
|
||||
#endif
|
||||
|
||||
//! @name Check SIMD support
|
||||
//! @{
|
||||
//! @brief Check CPU capability of SIMD operation
|
||||
static inline bool hasSIMD128()
|
||||
{
|
||||
return checkHardwareSupport(CV_CPU_SSE2);
|
||||
}
|
||||
|
||||
//! @}
|
||||
|
||||
//! @endcond
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user