mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 14:13:15 +08:00
Merge pull request #3562 from asmorkalov:ocv_aarch64
This commit is contained in:
commit
ad71efb2cb
2
3rdparty/libpng/CMakeLists.txt
vendored
2
3rdparty/libpng/CMakeLists.txt
vendored
@ -14,7 +14,7 @@ ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" ${ZLIB_INCLUDE_DIR})
|
||||
file(GLOB lib_srcs *.c)
|
||||
file(GLOB lib_hdrs *.h)
|
||||
|
||||
if(NEON AND CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
if(ARM AND NEON)
|
||||
list(APPEND lib_srcs arm/filter_neon.S)
|
||||
add_definitions(-DPNG_ARM_NEON)
|
||||
endif()
|
||||
|
40
3rdparty/tbb/CMakeLists.txt
vendored
40
3rdparty/tbb/CMakeLists.txt
vendored
@ -5,21 +5,26 @@ if (WIN32 AND NOT ARM)
|
||||
message(FATAL_ERROR "BUILD_TBB option supports Windows on ARM only!\nUse regular official TBB build instead of the BUILD_TBB option!")
|
||||
endif()
|
||||
|
||||
if (WIN32 AND ARM)
|
||||
# 4.1 update 4 - The first release that supports Windows RT. Hangs on some Android devices
|
||||
set(tbb_ver "tbb41_20130613oss")
|
||||
set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
|
||||
set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
|
||||
set(tbb_version_file "version_string.ver")
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
|
||||
else()
|
||||
# 4.1 update 2 - works fine
|
||||
set(tbb_ver "tbb41_20130116oss")
|
||||
set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130116oss_src.tgz")
|
||||
set(tbb_md5 "3809790e1001a1b32d59c9fee590ee85")
|
||||
set(tbb_version_file "version_string.ver")
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
|
||||
endif()
|
||||
set(tbb_ver "tbb43_20141204oss")
|
||||
set(tbb_url "http://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb43_20141204oss_src.tgz")
|
||||
set(tbb_md5 "e903dd92d9433701f097fa7ca29a3c1f")
|
||||
set(tbb_version_file "version_string.ver")
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
|
||||
|
||||
# 4.1 update 4 - The first release that supports Windows RT. Hangs on some Android devices
|
||||
#set(tbb_ver "tbb41_20130613oss")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130613oss_src.tgz")
|
||||
#set(tbb_md5 "108c8c1e481b0aaea61878289eb28b6a")
|
||||
#set(tbb_version_file "version_string.ver")
|
||||
#ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)
|
||||
|
||||
# 4.1 update 2 - works fine
|
||||
#set(tbb_ver "tbb41_20130116oss")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20130116oss_src.tgz")
|
||||
#set(tbb_md5 "3809790e1001a1b32d59c9fee590ee85")
|
||||
#set(tbb_version_file "version_string.ver")
|
||||
#ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow)
|
||||
|
||||
# 4.1 update 3 dev - Hangs on some Android devices
|
||||
#set(tbb_ver "tbb41_20130401oss")
|
||||
@ -113,7 +118,7 @@ if(NOT EXISTS "${tbb_tarball}")
|
||||
message(STATUS "Downloading ${tbb_ver}_src.tgz")
|
||||
file(DOWNLOAD "${tbb_url}" "${tbb_tarball}" TIMEOUT 600 STATUS __statvar)
|
||||
if(NOT __statvar EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to download TBB sources: ${tbb_url}")
|
||||
message(FATAL_ERROR "Failed to download TBB sources (${__statvar}): ${tbb_url}")
|
||||
endif()
|
||||
getMD5("${tbb_tarball}" tbb_local_md5)
|
||||
if(NOT tbb_local_md5 STREQUAL tbb_md5)
|
||||
@ -169,6 +174,7 @@ if (WIN32)
|
||||
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} /APPCONTAINER")
|
||||
else()
|
||||
add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required
|
||||
-D__TBB_WEAK_SYMBOLS_PRESENT=0 #required for 4.3
|
||||
-D__TBB_BUILD=1 #required
|
||||
-D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk support
|
||||
-DTBB_USE_DEBUG=0 #just to be sure
|
||||
@ -198,7 +204,7 @@ endif()
|
||||
|
||||
set(TBB_SOURCE_FILES ${lib_srcs} ${lib_hdrs})
|
||||
|
||||
if (ARM AND NOT WIN32)
|
||||
if ((ARM OR AARCH64) AND NOT WIN32)
|
||||
if (NOT ANDROID)
|
||||
set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/arm_linux_stub.cpp")
|
||||
endif()
|
||||
|
@ -226,8 +226,8 @@ OCV_OPTION(ENABLE_SSE41 "Enable SSE4.1 instructions"
|
||||
OCV_OPTION(ENABLE_SSE42 "Enable SSE4.2 instructions" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_AVX "Enable AVX instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_AVX2 "Enable AVX2 instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_NEON "Enable NEON instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND ARM )
|
||||
OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND ARM )
|
||||
OCV_OPTION(ENABLE_NEON "Enable NEON instructions" AARCH64 IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64))
|
||||
OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" AARCH64 IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64))
|
||||
OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF )
|
||||
OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF )
|
||||
OCV_OPTION(ENABLE_WINRT_MODE "Build with Windows Runtime support" OFF IF WIN32 )
|
||||
|
@ -91,8 +91,13 @@ if(CUDA_FOUND)
|
||||
|
||||
if(NOT DEFINED __cuda_arch_bin)
|
||||
if(ANDROID)
|
||||
set(__cuda_arch_bin "3.2")
|
||||
set(__cuda_arch_ptx "")
|
||||
if (ARM)
|
||||
set(__cuda_arch_bin "3.2")
|
||||
set(__cuda_arch_ptx "")
|
||||
elseif(AARCH64)
|
||||
set(__cuda_arch_bin "5.2")
|
||||
set(__cuda_arch_ptx "")
|
||||
endif()
|
||||
else()
|
||||
if(${CUDA_VERSION} VERSION_LESS "5.0")
|
||||
set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
|
||||
@ -154,7 +159,10 @@ if(CUDA_FOUND)
|
||||
|
||||
if(ANDROID)
|
||||
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xptxas;-dlcm=ca")
|
||||
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-target-os-variant=Android")
|
||||
if(${CUDA_VERSION} VERSION_LESS "7.0")
|
||||
# since CUDA 7.0 OS variant is depricated
|
||||
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-target-os-variant=Android")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "CUDA NVCC target flags: ${CUDA_NVCC_FLAGS}")
|
||||
|
@ -109,6 +109,8 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*|amd64.*|AMD64.*")
|
||||
set(X86 1)
|
||||
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*|ARM.*")
|
||||
set(ARM 1)
|
||||
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64.*|AARCH64.*")
|
||||
set(AARCH64 1)
|
||||
endif()
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@
|
||||
|
||||
#include <float.h>
|
||||
|
||||
#if defined(__GNUC__) && !defined(__APPLE__) && !defined(__arm__)
|
||||
#if defined(__GNUC__) && !defined(__APPLE__) && !defined(__arm__) && !defined(__aarch64__)
|
||||
#include <fpu_control.h>
|
||||
#endif
|
||||
|
||||
@ -58,7 +58,7 @@ namespace
|
||||
~FpuControl();
|
||||
|
||||
private:
|
||||
#if defined(__GNUC__) && !defined(__APPLE__) && !defined(__arm__)
|
||||
#if defined(__GNUC__) && !defined(__APPLE__) && !defined(__arm__) && !defined (__aarch64__)
|
||||
fpu_control_t fpu_oldcw, fpu_cw;
|
||||
#elif defined(_WIN32) && !defined(_WIN64)
|
||||
unsigned int fpu_oldcw, fpu_cw;
|
||||
@ -67,7 +67,7 @@ namespace
|
||||
|
||||
FpuControl::FpuControl()
|
||||
{
|
||||
#if defined(__GNUC__) && !defined(__APPLE__) && !defined(__arm__)
|
||||
#if defined(__GNUC__) && !defined(__APPLE__) && !defined(__arm__) && !defined(__aarch64__)
|
||||
_FPU_GETCW(fpu_oldcw);
|
||||
fpu_cw = (fpu_oldcw & ~_FPU_EXTENDED & ~_FPU_DOUBLE & ~_FPU_SINGLE) | _FPU_SINGLE;
|
||||
_FPU_SETCW(fpu_cw);
|
||||
@ -80,7 +80,7 @@ namespace
|
||||
|
||||
FpuControl::~FpuControl()
|
||||
{
|
||||
#if defined(__GNUC__) && !defined(__APPLE__) && !defined(__arm__)
|
||||
#if defined(__GNUC__) && !defined(__APPLE__) && !defined(__arm__) && !defined(__aarch64__)
|
||||
_FPU_SETCW(fpu_oldcw);
|
||||
#elif defined(_WIN32) && !defined(_WIN64)
|
||||
_controlfp_s(&fpu_cw, fpu_oldcw, _MCW_PC);
|
||||
|
@ -50,8 +50,9 @@
|
||||
#include "precomp.hpp"
|
||||
#include "grfmt_tiff.hpp"
|
||||
|
||||
#define int64 int64_tiff
|
||||
#define uint64 uint64_tiff
|
||||
#if !defined _MSC_VER && !defined __BORLANDC__
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TIFF
|
||||
# include "tiff.h"
|
||||
|
Loading…
Reference in New Issue
Block a user