Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
3dee87b6
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3dee87b6
编写于
6月 09, 2017
作者:
A
Alexander Alekhin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update CPU detection on ANDROID patch
上级
bb3a4163
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
44 addition
and
20 deletion
+44
-20
3rdparty/cpufeatures/CMakeLists.txt
3rdparty/cpufeatures/CMakeLists.txt
+13
-11
3rdparty/cpufeatures/LICENSE
3rdparty/cpufeatures/LICENSE
+13
-0
3rdparty/cpufeatures/README.md
3rdparty/cpufeatures/README.md
+4
-0
3rdparty/libwebp/CMakeLists.txt
3rdparty/libwebp/CMakeLists.txt
+1
-1
CMakeLists.txt
CMakeLists.txt
+4
-0
modules/core/CMakeLists.txt
modules/core/CMakeLists.txt
+2
-2
modules/core/src/system.cpp
modules/core/src/system.cpp
+7
-6
未找到文件。
3rdparty/cpufeatures/CMakeLists.txt
浏览文件 @
3dee87b6
if
(
NOT ANDROID
)
message
(
"cpufeatures is ANDROID project"
)
endif
()
ocv_include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
)
file
(
GLOB cpuf_s *.c
)
file
(
GLOB cpuf_h *.h
)
set
(
CPUFEATURES_ROOT
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
CACHE PATH
"Android cpufeatures project sources (for example, <android-ndk>/sources/android/cpufeatures)"
)
set
(
lib_srcs
${
cpuf_s
}
)
set
(
lib_hdrs
${
cpuf_h
}
)
set
(
CPUFEATURES_INCLUDE_DIRS
${
CPUFEATURES_ROOT
}
CACHE INTERNAL
""
)
set
(
CPUFEATURES_LIBRARIES cpufeatures CACHE INTERNAL
""
)
set
(
CPUFEATURES_INCLUDE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
CACHE INTERNAL
""
)
set
(
CPUFEATURES_LIBRARIES cpufeatures CACHE INTERNAL
""
)
if
(
NOT DEFINED CPUFEATURES_SOURCES
)
set
(
CPUFEATURES_SOURCES
${
CPUFEATURES_ROOT
}
/cpu-features.c
${
CPUFEATURES_ROOT
}
/cpu-features.h
)
endif
()
add_library
(
cpufeatures STATIC
${
lib_srcs
}
${
lib_hdrs
}
)
include_directories
(
${
CPUFEATURES_INCLUDE_DIRS
}
)
add_library
(
cpufeatures STATIC
${
CPUFEATURES_SOURCES
}
)
set_target_properties
(
cpufeatures
PROPERTIES OUTPUT_NAME cpufeatures
...
...
@@ -17,8 +20,8 @@ set_target_properties(cpufeatures
COMPILE_PDB_NAME cpufeatures
COMPILE_PDB_NAME_DEBUG
"cpufeatures
${
OPENCV_DEBUG_POSTFIX
}
"
ARCHIVE_OUTPUT_DIRECTORY
${
3P_LIBRARY_OUTPUT_PATH
}
)
)
if
(
ENABLE_SOLUTION_FOLDERS
)
set_target_properties
(
cpufeatures PROPERTIES FOLDER
"3rdparty"
)
endif
()
...
...
@@ -26,4 +29,3 @@ endif()
if
(
NOT BUILD_SHARED_LIBS
)
ocv_install_target
(
cpufeatures EXPORT OpenCVModules ARCHIVE DESTINATION
${
OPENCV_3P_LIB_INSTALL_PATH
}
COMPONENT dev
)
endif
()
3rdparty/cpufeatures/LICENSE
0 → 100644
浏览文件 @
3dee87b6
Copyright (C) 2016 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
3rdparty/cpufeatures/README.md
0 → 100644
浏览文件 @
3dee87b6
The Android NDK provides a small library named cpufeatures that your app can use at runtime to detect the target device's CPU family and the optional features it supports.
It is designed to work as-is on all official Android platform versions.
https://developer.android.com/ndk/guides/cpu-features.html
3rdparty/libwebp/CMakeLists.txt
浏览文件 @
3dee87b6
...
...
@@ -5,7 +5,7 @@
project
(
${
WEBP_LIBRARY
}
)
ocv_include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
)
ocv_include_directories
(
"
${
CPUFEATURES_INCLUDE_DIR
}
"
)
ocv_include_directories
(
${
CPUFEATURES_INCLUDE_DIRS
}
)
file
(
GLOB lib_srcs dec/*.c demux/*.c dsp/*.c enc/*.c mux/*.c utils/*.c webp/*.c
)
file
(
GLOB lib_hdrs dec/*.h demux/*.h dsp/*.h enc/*.h mux/*.h utils/*.h webp/*.h
)
...
...
CMakeLists.txt
浏览文件 @
3dee87b6
...
...
@@ -98,6 +98,10 @@ if(POLICY CMP0042)
cmake_policy
(
SET CMP0042 NEW
)
endif
()
if
(
POLICY CMP0046
)
cmake_policy
(
SET CMP0046 OLD
)
endif
()
if
(
POLICY CMP0051
)
cmake_policy
(
SET CMP0051 NEW
)
endif
()
...
...
modules/core/CMakeLists.txt
浏览文件 @
3dee87b6
...
...
@@ -32,10 +32,10 @@ source_group("Src" FILES "${OPENCV_MODULE_opencv_core_BINARY_DIR}/version_string
ocv_glob_module_sources
(
SOURCES
"
${
OPENCV_MODULE_opencv_core_BINARY_DIR
}
/version_string.inc"
HEADERS
${
lib_cuda_hdrs
}
${
lib_cuda_hdrs_detail
}
)
ocv_module_include_directories
(
${
the_module
}
${
ZLIB_INCLUDE_DIRS
}
${
OPENCL_INCLUDE_DIRS
}
${
CPUFEATURES_INCLUDE_DIR
}
)
ocv_module_include_directories
(
${
the_module
}
${
ZLIB_INCLUDE_DIRS
}
${
OPENCL_INCLUDE_DIRS
}
${
CPUFEATURES_INCLUDE_DIR
S
}
)
ocv_create_module
(
${
extra_libs
}
)
ocv_target_link_libraries
(
${
the_module
}
${
ZLIB_LIBRARIES
}
"
${
OPENCL_LIBRARIES
}
"
"
${
VA_LIBRARIES
}
"
"
${
LAPACK_LIBRARIES
}
"
"
${
CPUFEATURES_LIBRARIES
}
"
)
ocv_target_link_libraries
(
${
the_module
}
${
ZLIB_LIBRARIES
}
"
${
OPENCL_LIBRARIES
}
"
"
${
VA_LIBRARIES
}
"
"
${
LAPACK_LIBRARIES
}
"
"
${
CPUFEATURES_LIBRARIES
}
"
)
ocv_add_accuracy_tests
()
ocv_add_perf_tests
()
modules/core/src/system.cpp
浏览文件 @
3dee87b6
...
...
@@ -447,10 +447,16 @@ struct HWFeatures
CV_UNUSED
(
cpuid_data_ex
);
#endif // OPENCV_HAVE_X86_CPUID
#if defined
ANDROID
|| defined __linux__
#if defined
__ANDROID__
|| defined __linux__
#ifdef __aarch64__
have
[
CV_CPU_NEON
]
=
true
;
have
[
CV_CPU_FP16
]
=
true
;
#elif defined __arm__ && defined __ANDROID__
__android_log_print
(
ANDROID_LOG_INFO
,
"OpenCV"
,
"calling android_getCpuFeatures() ..."
);
uint64_t
features
=
android_getCpuFeatures
();
__android_log_print
(
ANDROID_LOG_INFO
,
"OpenCV"
,
"calling android_getCpuFeatures() ... Done (%llx)"
,
features
);
have
[
CV_CPU_NEON
]
=
(
features
&
ANDROID_CPU_ARM_FEATURE_NEON
)
!=
0
;
have
[
CV_CPU_FP16
]
=
(
features
&
ANDROID_CPU_ARM_FEATURE_VFP_FP16
)
!=
0
;
#elif defined __arm__
int
cpufile
=
open
(
"/proc/self/auxv"
,
O_RDONLY
);
...
...
@@ -471,11 +477,6 @@ struct HWFeatures
close
(
cpufile
);
}
#ifdef ANDROID
uint64_t
features
=
android_getCpuFeatures
();
have
[
CV_CPU_NEON
]
=
(
features
&
ANDROID_CPU_ARM_FEATURE_NEON
)
!=
0
;
have
[
CV_CPU_FP16
]
=
(
features
&
ANDROID_CPU_ARM_FEATURE_VFP_FP16
)
!=
0
;
#endif
#endif
#elif (defined __clang__ || defined __APPLE__)
#if (defined __ARM_NEON__ || (defined __ARM_NEON && defined __aarch64__))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录