Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
4ea1c935
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
4ea1c935
编写于
9月 06, 2018
作者:
R
Ruilong Liu
提交者:
GitHub
9月 06, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #916 from dolphin8/develop
add openmp support for ios
上级
f2a71638
8c8652c8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
4 deletion
+21
-4
CMakeLists.txt
CMakeLists.txt
+13
-2
src/ios_io/PaddleMobile.mm
src/ios_io/PaddleMobile.mm
+1
-0
tools/ios-cmake/ios.toolchain.cmake
tools/ios-cmake/ios.toolchain.cmake
+7
-2
未找到文件。
CMakeLists.txt
浏览文件 @
4ea1c935
cmake_minimum_required
(
VERSION 3.6
)
cmake_minimum_required
(
VERSION 3.6
)
option
(
USE_OPENMP
"openmp support"
ON
)
project
(
paddle-mobile
)
project
(
paddle-mobile
)
option
(
DEBUGING
"enable debug mode"
OFF
)
option
(
DEBUGING
"enable debug mode"
OFF
)
option
(
USE_OPENMP
"openmp support"
OFF
)
option
(
USE_EXCEPTION
"use std exception"
OFF
)
option
(
USE_EXCEPTION
"use std exception"
OFF
)
option
(
LOG_PROFILE
"log profile"
OFF
)
option
(
LOG_PROFILE
"log profile"
OFF
)
# select the platform to build
# select the platform to build
...
@@ -149,7 +150,17 @@ if (ANDROID_NDK_TOOLCHAIN_INCLUDED)
...
@@ -149,7 +150,17 @@ if (ANDROID_NDK_TOOLCHAIN_INCLUDED)
list
(
REMOVE_DUPLICATES CMAKE_CXX_FLAGS
)
list
(
REMOVE_DUPLICATES CMAKE_CXX_FLAGS
)
add_library
(
paddle-mobile SHARED
${
PADDLE_MOBILE_CC
}
${
PADDLE_MOBILE_H
}
)
add_library
(
paddle-mobile SHARED
${
PADDLE_MOBILE_CC
}
${
PADDLE_MOBILE_H
}
)
elseif
(
IS_IOS
)
elseif
(
IS_IOS
)
add_library
(
paddle-mobile STATIC
${
PADDLE_MOBILE_CC
}
${
PADDLE_MOBILE_H
}
)
if
(
USE_OPENMP
)
add_library
(
paddle-mobile-stage0 STATIC
${
PADDLE_MOBILE_CC
}
${
PADDLE_MOBILE_H
}
)
add_custom_target
(
paddle-mobile ALL
COMMAND libtool -static -o
${
CMAKE_BINARY_DIR
}
/libpaddle-mobile.a
${
CMAKE_CURRENT_LIST_DIR
}
/tools/libomp.a $<TARGET_FILE:paddle-mobile-stage0>
WORKING_DIRECTORY
${
CMAKE_BINARY_DIR
}
DEPENDS paddle-mobile
)
add_dependencies
(
paddle-mobile paddle-mobile-stage0
)
else
()
add_library
(
paddle-mobile STATIC
${
PADDLE_MOBILE_CC
}
${
PADDLE_MOBILE_H
}
)
endif
()
else
()
else
()
add_library
(
paddle-mobile SHARED
${
PADDLE_MOBILE_CC
}
${
PADDLE_MOBILE_H
}
)
add_library
(
paddle-mobile SHARED
${
PADDLE_MOBILE_CC
}
${
PADDLE_MOBILE_H
}
)
endif
()
endif
()
...
...
src/ios_io/PaddleMobile.mm
浏览文件 @
4ea1c935
...
@@ -58,6 +58,7 @@ static std::mutex shared_mutex;
...
@@ -58,6 +58,7 @@ static std::mutex shared_mutex;
-
(
BOOL
)
load
:(
NSString
*
)
modelPath
andWeightsPath
:(
NSString
*
)
weighsPath
{
-
(
BOOL
)
load
:(
NSString
*
)
modelPath
andWeightsPath
:(
NSString
*
)
weighsPath
{
std
::
string
model_path_str
=
std
::
string
([
modelPath
UTF8String
]);
std
::
string
model_path_str
=
std
::
string
([
modelPath
UTF8String
]);
std
::
string
weights_path_str
=
std
::
string
([
weighsPath
UTF8String
]);
std
::
string
weights_path_str
=
std
::
string
([
weighsPath
UTF8String
]);
pam_
->
SetThreadNum
(
2
);
if
(
loaded_
=
pam_
->
Load
(
model_path_str
,
weights_path_str
,
true
))
{
if
(
loaded_
=
pam_
->
Load
(
model_path_str
,
weights_path_str
,
true
))
{
return
YES
;
return
YES
;
}
else
{
}
else
{
...
...
tools/ios-cmake/ios.toolchain.cmake
浏览文件 @
4ea1c935
...
@@ -50,8 +50,13 @@ endif (CMAKE_UNAME)
...
@@ -50,8 +50,13 @@ endif (CMAKE_UNAME)
#include (CMakeForceCompiler)
#include (CMakeForceCompiler)
#CMAKE_C_COMPILER (/usr/bin/gcc)
#CMAKE_C_COMPILER (/usr/bin/gcc)
#CMAKE_CXX_COMPILER (/usr/bin/g++)
#CMAKE_CXX_COMPILER (/usr/bin/g++)
set
(
CMAKE_C_COMPILER /usr/bin/gcc
)
if
(
USE_OPENMP
)
set
(
CMAKE_CXX_COMPILER /usr/bin/g++
)
set
(
CMAKE_C_COMPILER /usr/local/opt/llvm/bin/clang
)
set
(
CMAKE_CXX_COMPILER /usr/local/opt/llvm/bin/clang++
)
else
()
set
(
CMAKE_C_COMPILER /usr/bin/gcc
)
set
(
CMAKE_CXX_COMPILER /usr/bin/g++
)
endif
()
set
(
CMAKE_AR ar CACHE FILEPATH
""
FORCE
)
set
(
CMAKE_AR ar CACHE FILEPATH
""
FORCE
)
# Skip the platform compiler checks for cross compiling
# Skip the platform compiler checks for cross compiling
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录