deepin-ocr/3rdparty/opencv-4.5.4/samples/cpp/simd_basic.cpp
wangzhengyang 718c41634f feat: 切换后端至PaddleOCR-NCNN,切换工程为CMake
1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试
2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程
3.重整权利声明文件,重整代码工程,确保最小化侵权风险

Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake
Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
2022-05-10 10:22:11 +08:00

50 lines
1.6 KiB
C++

#include "opencv2/core.hpp"
#include "opencv2/core/simd_intrinsics.hpp"
using namespace cv;
int main(int /*argc*/, char** /*argv*/)
{
printf("================== macro dump ===================\n");
#ifdef CV_SIMD
printf("CV_SIMD is defined: " CVAUX_STR(CV_SIMD) "\n");
#ifdef CV_SIMD_WIDTH
printf("CV_SIMD_WIDTH is defined: " CVAUX_STR(CV_SIMD_WIDTH) "\n");
#endif
#ifdef CV_SIMD128
printf("CV_SIMD128 is defined: " CVAUX_STR(CV_SIMD128) "\n");
#endif
#ifdef CV_SIMD256
printf("CV_SIMD256 is defined: " CVAUX_STR(CV_SIMD256) "\n");
#endif
#ifdef CV_SIMD512
printf("CV_SIMD512 is defined: " CVAUX_STR(CV_SIMD512) "\n");
#endif
#ifdef CV_SIMD_64F
printf("CV_SIMD_64F is defined: " CVAUX_STR(CV_SIMD_64F) "\n");
#endif
#ifdef CV_SIMD_FP16
printf("CV_SIMD_FP16 is defined: " CVAUX_STR(CV_SIMD_FP16) "\n");
#endif
#else
printf("CV_SIMD is NOT defined\n");
#endif
#ifdef CV_SIMD
printf("================= sizeof checks =================\n");
printf("sizeof(v_uint8) = %d\n", (int)sizeof(v_uint8));
printf("sizeof(v_int32) = %d\n", (int)sizeof(v_int32));
printf("sizeof(v_float32) = %d\n", (int)sizeof(v_float32));
printf("================== arithm check =================\n");
v_uint8 a = vx_setall_u8(10);
v_uint8 c = a + vx_setall_u8(45);
printf("(vx_setall_u8(10) + vx_setall_u8(45)).get0() => %d\n", (int)c.get0());
#else
printf("\nSIMD intrinsics are not available. Check compilation target and passed build options.\n");
#endif
printf("===================== done ======================\n");
return 0;
}