Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
ab2ba2fe
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看板
提交
ab2ba2fe
编写于
1月 22, 2019
作者:
H
hjchen2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix compile warning, disable openmp for ios ci build
上级
0e9a2fa2
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
19 addition
and
15 deletion
+19
-15
src/common/log.h
src/common/log.h
+1
-4
src/io/jni/paddle_mobile_jni.cpp
src/io/jni/paddle_mobile_jni.cpp
+7
-7
src/io/jni/paddle_mobile_jni.h
src/io/jni/paddle_mobile_jni.h
+5
-1
src/operators/kernel/arm/quantize_kernel.cpp
src/operators/kernel/arm/quantize_kernel.cpp
+1
-1
src/operators/kernel/central-arm-func/gru_unit_arm_func.h
src/operators/kernel/central-arm-func/gru_unit_arm_func.h
+1
-0
src/operators/math/quantize.h
src/operators/math/quantize.h
+2
-2
tools/ci_build.sh
tools/ci_build.sh
+2
-0
未找到文件。
src/common/log.h
浏览文件 @
ab2ba2fe
...
...
@@ -175,11 +175,8 @@ struct Print {
friend
struct
ToLog
;
template
<
typename
T
>
Print
&
operator
<<
(
T
const
&
value
)
{
Print
p
=
Print
();
return
p
;
return
*
this
;
}
private:
};
struct
ToLog
{
...
...
src/io/jni/paddle_mobile_jni.cpp
浏览文件 @
ab2ba2fe
...
...
@@ -39,7 +39,7 @@ using framework::Tensor;
using
paddle_mobile
::
CPU
;
using
std
::
string
;
extern
const
char
*
ANDROID_LOG_TAG
=
const
char
*
ANDROID_LOG_TAG
=
"paddle_mobile LOG built on "
__DATE__
" "
__TIME__
;
paddle_mobile
::
PaddleMobile
<
paddle_mobile
::
CPU
>
paddle_mobile
;
static
std
::
mutex
shared_mutex
;
...
...
@@ -53,25 +53,25 @@ string jstring2cppstring(JNIEnv *env, jstring jstr) {
return
cppstr
;
}
JNIEXPORT
jboolean
JNICALL
Java_com_baidu_paddle_PML_load
(
JNIEnv
*
env
,
jclass
thiz
,
jstring
modelPath
)
{
JNIEXPORT
jboolean
JNICALL
Java_com_baidu_paddle_PML_load
(
JNIEnv
*
env
,
jclass
thiz
,
jstring
modelPath
,
jboolean
lod_mode
=
false
)
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
shared_mutex
);
ANDROIDLOGI
(
"load invoked"
);
bool
optimize
=
true
;
bool
isLoadOk
=
false
;
#ifdef ENABLE_EXCEPTION
try
{
isLoadOk
=
getPaddleMobileInstance
()
->
Load
(
jstring2cppstring
(
env
,
modelPath
),
optimize
);
jstring2cppstring
(
env
,
modelPath
),
optimize
,
false
,
1
,
static_cast
<
bool
>
(
lod_mode
));
}
catch
(
paddle_mobile
::
PaddleMobileException
&
e
)
{
ANDROIDLOGE
(
"jni got an PaddleMobileException! "
,
e
.
what
());
isLoadOk
=
false
;
}
#else
isLoadOk
=
getPaddleMobileInstance
()
->
Load
(
jstring2cppstring
(
env
,
modelPath
),
optimize
);
optimize
,
false
,
1
,
static_cast
<
bool
>
(
lod_mode
));
#endif
return
static_cast
<
jboolean
>
(
isLoadOk
);
}
...
...
src/io/jni/paddle_mobile_jni.h
浏览文件 @
ab2ba2fe
...
...
@@ -26,7 +26,8 @@ namespace jni {
*/
JNIEXPORT
jboolean
JNICALL
Java_com_baidu_paddle_PML_load
(
JNIEnv
*
env
,
jclass
thiz
,
jstring
modelPath
);
jstring
modelPath
,
jboolean
lod_mode
);
/**
* load separated qualified model for android
...
...
@@ -64,6 +65,9 @@ JNIEXPORT jfloatArray JNICALL Java_com_baidu_paddle_PML_predictYuv(
JNIEXPORT
jfloatArray
JNICALL
Java_com_baidu_paddle_PML_predict
(
JNIEnv
*
env
,
jclass
thiz
,
jfloatArray
buf
);
JNIEXPORT
jlongArray
JNICALL
Java_com_baidu_paddle_PML_predictLod
(
JNIEnv
*
env
,
jclass
thiz
,
jlongArray
buf
);
/**
* setThreadCount for multithread
*/
...
...
src/operators/kernel/arm/quantize_kernel.cpp
浏览文件 @
ab2ba2fe
...
...
@@ -167,7 +167,7 @@ float find_abs_max(const Tensor *input) {
max_abs
=
vmaxvq_f32
(
__max
);
#endif
for
(
size_t
i
=
0
;
i
<
remain
;
++
i
)
{
max_abs
=
std
::
max
(
max_abs
,
std
::
abs
(
x
[
i
]));
max_abs
=
std
::
max
(
max_abs
,
f
abs
(
x
[
i
]));
}
return
max_abs
;
}
...
...
src/operators/kernel/central-arm-func/gru_unit_arm_func.h
浏览文件 @
ab2ba2fe
...
...
@@ -21,6 +21,7 @@ limitations under the License. */
#include "operators/math/gemm.h"
#include "operators/math/math_function.h"
#include "operators/op_param.h"
namespace
paddle_mobile
{
namespace
operators
{
...
...
src/operators/math/quantize.h
浏览文件 @
ab2ba2fe
...
...
@@ -40,8 +40,8 @@ template <>
inline
int8_t
Round
<
ROUND_NEAREST_TO_EVEN
>
(
const
float
&
x
)
{
float
v
=
std
::
round
(
x
);
int32_t
q
=
static_cast
<
int32_t
>
(
v
);
if
(
std
::
abs
(
std
::
abs
(
q
-
v
)
-
0.5
)
<=
0
)
{
if
(
std
::
abs
(
q
)
%
2
!=
0
)
{
if
(
fabs
(
f
abs
(
q
-
v
)
-
0.5
)
<=
0
)
{
if
(
abs
(
q
)
%
2
!=
0
)
{
q
=
q
+
((
q
>
0
)
?
-
1
:
1
);
}
}
...
...
tools/ci_build.sh
浏览文件 @
ab2ba2fe
...
...
@@ -146,6 +146,7 @@ function build_ios_armv8_cpu_only() {
-DIOS_PLATFORM
=
OS
\
-DIOS_ARCH
=
"
${
IOS_ARCH
}
"
\
-DIS_IOS
=
true
\
-DUSE_OPENMP
=
OFF
\
-DGPU_MALI
=
OFF
\
-DGPU_CL
=
OFF
\
-DFPGA
=
OFF
...
...
@@ -163,6 +164,7 @@ function build_ios_armv8_gpu() {
-DIOS_PLATFORM
=
OS
\
-DIOS_ARCH
=
"
${
IOS_ARCH
}
"
\
-DIS_IOS
=
true
\
-DUSE_OPENMP
=
OFF
\
-DGPU_MALI
=
OFF
\
-DGPU_CL
=
ON
\
-DFPGA
=
OFF
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录