1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

fix android pack build

This commit is contained in:
Alexander Alekhin
2016-07-18 17:45:16 +03:00
parent 705e776f09
commit 2ec63e4dd1
6 changed files with 80 additions and 4 deletions
+15
View File
@@ -369,3 +369,18 @@ if(MSVC)
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4589) # Constructor of abstract class 'cv::ORB' ignores initializer for virtual base class 'cv::Algorithm'
endif()
endif()
if(NOT OPENCV_FP16_DISABLE)
try_compile(__VALID_FP16
"${OpenCV_BINARY_DIR}"
"${OpenCV_SOURCE_DIR}/cmake/checks/fp16.cpp"
COMPILE_DEFINITIONS "-DCHECK_FP16"
OUTPUT_VARIABLE TRY_OUT
)
if(NOT __VALID_FP16)
message(STATUS "FP16: Compiler support is not available")
else()
message(STATUS "FP16: Compiler support is available")
set(HAVE_FP16 1)
endif()
endif()
+33
View File
@@ -0,0 +1,33 @@
#include <stdio.h>
#if defined __F16C__ || (defined _MSC_VER && _MSC_VER >= 1700)
#include <immintrin.h>
int test()
{
const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f };
short dst[8];
__m128 v_src = _mm_load_ps(src);
__m128i v_dst = _mm_cvtps_ph(v_src, 0);
_mm_storel_epi64((__m128i*)dst, v_dst);
return (int)dst[0];
}
#elif defined __GNUC__ && (defined __arm__ || defined __aarch64__)
#include "arm_neon.h"
int test()
{
const float src[] = { 0.0f, 0.0f, 0.0f, 0.0f };
short dst[8];
float32x4_t v_src = *(float32x4_t*)src;
float16x4_t v_dst = vcvt_f16_f32(v_src);
*(float16x4_t*)dst = v_dst;
return (int)dst[0];
}
#else
#error "FP16 is not supported"
#endif
int main()
{
printf("%d\n", test());
return 0;
}
+3
View File
@@ -203,3 +203,6 @@
/* Lapack */
#cmakedefine HAVE_LAPACK
/* FP16 */
#cmakedefine HAVE_FP16