Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
fb38e662
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
fb38e662
编写于
8月 29, 2017
作者:
L
Liu Yiqun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Seperate the codes that cannot and don't need to build for iOS devices.
上级
43dde935
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
53 addition
and
36 deletion
+53
-36
CMakeLists.txt
CMakeLists.txt
+8
-3
cmake/cross_compiling/ios.cmake
cmake/cross_compiling/ios.cmake
+2
-0
paddle/CMakeLists.txt
paddle/CMakeLists.txt
+6
-2
paddle/capi/CMakeLists.txt
paddle/capi/CMakeLists.txt
+27
-29
paddle/utils/Excepts.h
paddle/utils/Excepts.h
+2
-1
paddle/utils/arch/linux/Locks.cpp
paddle/utils/arch/linux/Locks.cpp
+6
-0
paddle/utils/arch/osx/Excepts.cpp
paddle/utils/arch/osx/Excepts.cpp
+2
-1
未找到文件。
CMakeLists.txt
浏览文件 @
fb38e662
...
...
@@ -167,11 +167,16 @@ if(USE_NNPACK)
list
(
APPEND EXTERNAL_LIBS
${
NNPACK_LIBS
}
)
endif
(
USE_NNPACK
)
message
(
STATUS
"CMAKE_C_FLAGS:
${
CMAKE_C_FLAGS
}
"
)
message
(
STATUS
"CMAKE_CXX_FLAGS:
${
CMAKE_CXX_FLAGS
}
"
)
add_subdirectory
(
proto
)
# "add_subdirectory(go)" should be placed after the following loine,
# because it depends on paddle/optimizer.
add_subdirectory
(
paddle/optimizer
)
if
(
NOT ANDROID AND NOT IOS
)
# "add_subdirectory(go)" should be placed after the following loine,
# because it depends on paddle/optimizer.
add_subdirectory
(
paddle/optimizer
)
endif
()
# "add_subdirectory(paddle)" and "add_subdirectory(python)" should be
# placed after this block, because they depends on it.
...
...
cmake/cross_compiling/ios.cmake
浏览文件 @
fb38e662
...
...
@@ -289,6 +289,8 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
message
(
STATUS
"iOS: Targeting iOS '
${
CMAKE_SYSTEM_VERSION
}
', "
"building for '
${
IOS_PLATFORM
}
' platform, with architecture '
${
CMAKE_OSX_ARCHITECTURES
}
'"
)
message
(
STATUS
"System CMAKE_C_FLAGS:
${
CMAKE_C_FLAGS
}
"
)
message
(
STATUS
"System CMAKE_CXX_FLAGS:
${
CMAKE_CXX_FLAGS
}
"
)
# This little macro lets you set any XCode specific property
macro
(
set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE
)
...
...
paddle/CMakeLists.txt
浏览文件 @
fb38e662
...
...
@@ -5,8 +5,12 @@ add_subdirectory(testing)
add_subdirectory
(
math
)
add_subdirectory
(
parameter
)
add_subdirectory
(
gserver
)
add_subdirectory
(
pserver
)
add_subdirectory
(
trainer
)
if
(
NOT ANDROID AND NOT IOS
)
add_subdirectory
(
pserver
)
add_subdirectory
(
trainer
)
endif
()
add_subdirectory
(
scripts
)
add_subdirectory
(
string
)
...
...
paddle/capi/CMakeLists.txt
浏览文件 @
fb38e662
...
...
@@ -31,42 +31,40 @@ add_dependencies(paddle_capi paddle_proto)
# combine all paddle static libraries together, into libpaddle_capi_whole.a
# user should use PaddleCAPI as -lpaddle_capi_whole
set
(
capi_whole_library libpaddle_capi_whole.a
)
add_custom_target
(
paddle_capi_whole ALL
COMMAND mkdir -p o_files/capi && cd o_files/capi/ && ar -x $<TARGET_FILE:paddle_capi>
COMMAND mkdir -p o_files/utils && cd o_files/utils/ && ar -x $<TARGET_FILE:paddle_utils>
COMMAND mkdir -p o_files/parameter && cd o_files/parameter/ && ar -x $<TARGET_FILE:paddle_parameter>
COMMAND mkdir -p o_files/math && cd o_files/math/ && ar -x $<TARGET_FILE:paddle_math>
COMMAND mkdir -p o_files/cuda && cd o_files/cuda/ && ar -x $<TARGET_FILE:paddle_cuda>
COMMAND mkdir -p o_files/function && cd o_files/function/ && ar -x $<TARGET_FILE:paddle_function>
COMMAND mkdir -p o_files/gserver && cd o_files/gserver/ && ar -x $<TARGET_FILE:paddle_gserver>
COMMAND mkdir -p o_files/proto && cd o_files/proto/ && ar -x $<TARGET_FILE:paddle_proto>
COMMAND mkdir -p o_files/network && cd o_files/network/ && ar -x $<TARGET_FILE:paddle_network>
COMMAND mkdir -p o_files/pserver && cd o_files/pserver/ && ar -x $<TARGET_FILE:paddle_pserver>
COMMAND ar crs
${
capi_whole_library
}
`find ./o_files -name '*.o'`
COMMAND rm -rf o_files
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
DEPENDS paddle_capi paddle_utils paddle_parameter paddle_math
paddle_cuda paddle_function paddle_gserver
paddle_proto paddle_pserver paddle_network
set
(
PADDLE_INFER_LIBS
paddle_utils
paddle_parameter
paddle_math
paddle_cuda
paddle_function
paddle_gserver
paddle_proto
)
set_target_properties
(
paddle_capi_whole
PROPERTIES IMPORTED_LOCATION
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
capi_whole_library
}
)
add_library
(
paddle_capi_shared SHARED
${
CAPI_SOURCES
}
)
target_include_directories
(
paddle_capi_shared PUBLIC
${
CMAKE_CURRENT_BINARY_DIR
}
)
link_paddle_exe
(
paddle_capi_shared
)
set
(
PADDLE_TRAIN_LIBS paddle_pserver paddle_network
)
cc_library
(
paddle_capi_whole DEPS paddle_capi
${
PADDLE_INFER_LIBS
}
)
# No shared library for iOS
if
(
NOT IOS
)
add_library
(
paddle_capi_shared SHARED
${
CAPI_SOURCES
}
)
target_include_directories
(
paddle_capi_shared PUBLIC
${
CMAKE_CURRENT_BINARY_DIR
}
)
link_paddle_exe
(
paddle_capi_shared
)
endif
()
# install library & headers.
install
(
FILES
${
CAPI_HEADERS
}
DESTINATION include/paddle
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/config.h DESTINATION include/paddle
)
if
(
ANDROID
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
capi_whole_library
}
DESTINATION lib/
${
ANDROID_ABI
}
)
install
(
TARGETS paddle_capi_shared
DESTINATION lib/
${
ANDROID_ABI
}
)
install
(
TARGETS paddle_capi_whole paddle_capi_shared
ARCHIVE DESTINATION lib/
${
ANDROID_ABI
}
LIBRARY
DESTINATION lib/
${
ANDROID_ABI
}
)
else
(
ANDROID
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
capi_whole_library
}
DESTINATION lib
)
install
(
TARGETS paddle_capi_whole
ARCHIVE DESTINATION lib
)
if
(
NOT IOS
)
install
(
TARGETS paddle_capi_shared DESTINATION lib
)
endif
()
endif
(
ANDROID
)
# this variable used for unittest
...
...
paddle/utils/Excepts.h
浏览文件 @
fb38e662
...
...
@@ -17,7 +17,8 @@ limitations under the License. */
#include <fenv.h>
#if defined(__APPLE__) || defined(__OSX__)
#if (defined(__APPLE__) || defined(__OSX__)) && !defined(__arm__) && \
!defined(__aarch64__)
int
fegetexcept
(
void
);
int
feenableexcept
(
unsigned
int
excepts
);
...
...
paddle/utils/arch/linux/Locks.cpp
浏览文件 @
fb38e662
...
...
@@ -40,6 +40,8 @@ void Semaphore::wait() { sem_wait(&m->sem); }
void
Semaphore
::
post
()
{
sem_post
(
&
m
->
sem
);
}
/// SpinLockPrivate
#ifdef PADDLE_USE_PTHREAD_SPINLOCK
class
SpinLockPrivate
{
...
...
@@ -79,6 +81,8 @@ SpinLock::~SpinLock() { delete m; }
void
SpinLock
::
lock
()
{
m
->
lock
();
}
void
SpinLock
::
unlock
()
{
m
->
unlock
();
}
/// ThreadBarrierPrivate
#ifdef PADDLE_USE_PTHREAD_BARRIER
class
ThreadBarrierPrivate
{
...
...
@@ -136,6 +140,8 @@ public:
#endif
/// ThreadBarrier
ThreadBarrier
::
ThreadBarrier
(
int
count
)
:
m
(
new
ThreadBarrierPrivate
(
count
))
{}
ThreadBarrier
::~
ThreadBarrier
()
{
delete
m
;
}
void
ThreadBarrier
::
wait
()
{
m
->
wait
();
}
...
...
paddle/utils/arch/osx/Excepts.cpp
浏览文件 @
fb38e662
...
...
@@ -14,7 +14,8 @@ limitations under the License. */
#include "paddle/utils/Excepts.h"
#if defined(__APPLE__) || defined(__OSX__)
#if (defined(__APPLE__) || defined(__OSX__)) && !defined(__arm__) && \
!defined(__aarch64__)
int
fegetexcept
(
void
)
{
static
fenv_t
fenv
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录