Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
d60c9e7c
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看板
提交
d60c9e7c
编写于
10月 12, 2018
作者:
H
hjchen2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix compile options and revert jni cpp
上级
07117e54
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
5 addition
and
4 deletion
+5
-4
CMakeLists.txt
CMakeLists.txt
+2
-1
src/jni/paddle_mobile_jni.cpp
src/jni/paddle_mobile_jni.cpp
+2
-2
tools/pre-commit.hooks/cpplint.hook
tools/pre-commit.hooks/cpplint.hook
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
d60c9e7c
...
@@ -5,6 +5,7 @@ project(paddle-mobile)
...
@@ -5,6 +5,7 @@ project(paddle-mobile)
option
(
CPU
"armv7 with neon support"
ON
)
option
(
CPU
"armv7 with neon support"
ON
)
option
(
MALI_GPU
"mali gpu support"
OFF
)
option
(
MALI_GPU
"mali gpu support"
OFF
)
option
(
FPGA
"fpga support"
OFF
)
option
(
FPGA
"fpga support"
OFF
)
option
(
USE_OPENMP
"openmp support"
OFF
)
option
(
USE_OPENMP
"openmp support"
OFF
)
option
(
DEBUGING
"enable debug mode"
ON
)
option
(
DEBUGING
"enable debug mode"
ON
)
option
(
USE_EXCEPTION
"use std exception"
OFF
)
option
(
USE_EXCEPTION
"use std exception"
OFF
)
...
@@ -15,7 +16,7 @@ file(GLOB_RECURSE PADDLE_MOBILE_H src/*.h)
...
@@ -15,7 +16,7 @@ file(GLOB_RECURSE PADDLE_MOBILE_H src/*.h)
include_directories
(
src/
)
include_directories
(
src/
)
set
(
CMAKE_BUILD_TYPE Release
)
set
(
CMAKE_BUILD_TYPE Release
)
add_definitions
(
-O3 -s -DNDEBUG
)
set
(
CMAKE_CXX_FLAGS
"-O3 -s -DNDEBUG
${
CMAKE_CXX_FLAGS
}
"
)
if
(
IS_IOS
)
if
(
IS_IOS
)
set
(
CMAKE_CXX_FLAGS
"-mfpu=neon -marm -fobjc-abi-version=2 -fobjc-arc \
set
(
CMAKE_CXX_FLAGS
"-mfpu=neon -marm -fobjc-abi-version=2 -fobjc-arc \
-std=gnu++11 -stdlib=libc++ -isysroot
${
CMAKE_OSX_SYSROOT
}
${
CMAKE_CXX_FLAGS
}
"
)
-std=gnu++11 -stdlib=libc++ -isysroot
${
CMAKE_OSX_SYSROOT
}
${
CMAKE_CXX_FLAGS
}
"
)
...
...
src/jni/paddle_mobile_jni.cpp
浏览文件 @
d60c9e7c
...
@@ -84,14 +84,14 @@ Java_com_baidu_paddle_PML_loadnlp(JNIEnv *env, jclass thiz, jstring modelPath) {
...
@@ -84,14 +84,14 @@ Java_com_baidu_paddle_PML_loadnlp(JNIEnv *env, jclass thiz, jstring modelPath) {
#ifdef ENABLE_EXCEPTION
#ifdef ENABLE_EXCEPTION
try
{
try
{
isLoadOk
=
getPaddleMobileInstance
()
->
Load
(
isLoadOk
=
getPaddleMobileInstance
()
->
Load
(
jstring2cppstring
(
env
,
modelPath
),
optimize
,
false
,
true
);
jstring2cppstring
(
env
,
modelPath
),
optimize
,
false
,
1
,
true
);
}
catch
(
paddle_mobile
::
PaddleMobileException
&
e
)
{
}
catch
(
paddle_mobile
::
PaddleMobileException
&
e
)
{
ANDROIDLOGE
(
"jni got an PaddleMobileException! "
,
e
.
what
());
ANDROIDLOGE
(
"jni got an PaddleMobileException! "
,
e
.
what
());
isLoadOk
=
false
;
isLoadOk
=
false
;
}
}
#else
#else
isLoadOk
=
getPaddleMobileInstance
()
->
Load
(
jstring2cppstring
(
env
,
modelPath
),
isLoadOk
=
getPaddleMobileInstance
()
->
Load
(
jstring2cppstring
(
env
,
modelPath
),
optimize
,
false
,
true
);
optimize
,
false
,
1
,
true
);
#endif
#endif
return
static_cast
<
jboolean
>
(
isLoadOk
);
return
static_cast
<
jboolean
>
(
isLoadOk
);
}
}
...
...
tools/pre-commit.hooks/cpplint.hook
浏览文件 @
d60c9e7c
...
@@ -5,7 +5,7 @@ TOTAL_ERRORS=0
...
@@ -5,7 +5,7 @@ TOTAL_ERRORS=0
# The trick to remove deleted files: https://stackoverflow.com/a/2413151
# The trick to remove deleted files: https://stackoverflow.com/a/2413151
for
file
in
$(
git diff
--cached
--name-status
|
awk
'$1 != "D" {print $2}'
|
\
for
file
in
$(
git diff
--cached
--name-status
|
awk
'$1 != "D" {print $2}'
|
\
grep
-v
".pb.cpp"
|
grep
-v
".pb.h"
|
grep
-v
".pb-c.h"
|
grep
-v
".pb-c.c"
|
\
grep
-v
".pb.cpp"
|
grep
-v
".pb.h"
|
grep
-v
".pb-c.h"
|
grep
-v
".pb-c.c"
|
\
grep
-v
"protobuf-c.h"
|
grep
-v
"protobuf-c.c"
)
;
do
grep
-v
"protobuf-c.h"
|
grep
-v
"protobuf-c.c"
|
grep
-v
"jni.cpp"
)
;
do
cpplint
$file
;
cpplint
$file
;
TOTAL_ERRORS
=
$(
expr
$TOTAL_ERRORS
+
$?
)
;
TOTAL_ERRORS
=
$(
expr
$TOTAL_ERRORS
+
$?
)
;
done
done
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录