Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
2042a830
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
337
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看板
提交
2042a830
编写于
3月 19, 2020
作者:
Z
ZHANG Shijin
提交者:
jackzhang235
3月 24, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix python api compilation err, add MLU func in python API
上级
f211ef41
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
6 deletion
+12
-6
lite/api/python/pybind/pybind.cc
lite/api/python/pybind/pybind.cc
+11
-5
lite/tools/build_mlu.sh
lite/tools/build_mlu.sh
+1
-1
未找到文件。
lite/api/python/pybind/pybind.cc
浏览文件 @
2042a830
...
@@ -31,9 +31,6 @@
...
@@ -31,9 +31,6 @@
#include "lite/api/light_api.h"
#include "lite/api/light_api.h"
#include "lite/api/paddle_api.h"
#include "lite/api/paddle_api.h"
#include "lite/api/paddle_use_kernels.h"
#include "lite/api/paddle_use_ops.h"
#include "lite/core/tensor.h"
namespace
py
=
pybind11
;
namespace
py
=
pybind11
;
...
@@ -49,6 +46,7 @@ using lite_api::TargetType;
...
@@ -49,6 +46,7 @@ using lite_api::TargetType;
using
lite_api
::
PrecisionType
;
using
lite_api
::
PrecisionType
;
using
lite_api
::
DataLayoutType
;
using
lite_api
::
DataLayoutType
;
using
lite_api
::
Place
;
using
lite_api
::
Place
;
using
lite_api
::
MLUCoreVersion
;
using
lite
::
LightPredictorImpl
;
using
lite
::
LightPredictorImpl
;
#ifndef LITE_ON_TINY_PUBLISH
#ifndef LITE_ON_TINY_PUBLISH
...
@@ -61,6 +59,7 @@ static void BindLiteMobileConfig(py::module *m);
...
@@ -61,6 +59,7 @@ static void BindLiteMobileConfig(py::module *m);
static
void
BindLitePowerMode
(
py
::
module
*
m
);
static
void
BindLitePowerMode
(
py
::
module
*
m
);
static
void
BindLitePlace
(
py
::
module
*
m
);
static
void
BindLitePlace
(
py
::
module
*
m
);
static
void
BindLiteTensor
(
py
::
module
*
m
);
static
void
BindLiteTensor
(
py
::
module
*
m
);
static
void
BindLiteMLUCoreVersion
(
py
::
module
*
m
);
void
BindLiteApi
(
py
::
module
*
m
)
{
void
BindLiteApi
(
py
::
module
*
m
)
{
BindLiteCxxConfig
(
m
);
BindLiteCxxConfig
(
m
);
...
@@ -68,6 +67,7 @@ void BindLiteApi(py::module *m) {
...
@@ -68,6 +67,7 @@ void BindLiteApi(py::module *m) {
BindLitePowerMode
(
m
);
BindLitePowerMode
(
m
);
BindLitePlace
(
m
);
BindLitePlace
(
m
);
BindLiteTensor
(
m
);
BindLiteTensor
(
m
);
BindLiteMLUCoreVersion
(
m
);
#ifndef LITE_ON_TINY_PUBLISH
#ifndef LITE_ON_TINY_PUBLISH
BindLiteCxxPredictor
(
m
);
BindLiteCxxPredictor
(
m
);
#endif
#endif
...
@@ -113,6 +113,8 @@ void BindLiteCxxConfig(py::module *m) {
...
@@ -113,6 +113,8 @@ void BindLiteCxxConfig(py::module *m) {
cxx_config
.
def
(
"set_use_firstconv"
,
&
CxxConfig
::
set_use_firstconv
)
cxx_config
.
def
(
"set_use_firstconv"
,
&
CxxConfig
::
set_use_firstconv
)
.
def
(
"set_mean"
,
&
CxxConfig
::
set_mean
)
.
def
(
"set_mean"
,
&
CxxConfig
::
set_mean
)
.
def
(
"set_std"
,
&
CxxConfig
::
set_std
)
.
def
(
"set_std"
,
&
CxxConfig
::
set_std
)
.
def
(
"set_mlu_core_version"
,
&
CxxConfig
::
set_mlu_core_version
)
.
def
(
"set_mlu_core_number"
,
&
CxxConfig
::
set_mlu_core_number
);
#endif
#endif
}
}
...
@@ -145,6 +147,12 @@ void BindLitePowerMode(py::module *m) {
...
@@ -145,6 +147,12 @@ void BindLitePowerMode(py::module *m) {
.
value
(
"LITE_POWER_RAND_LOW"
,
PowerMode
::
LITE_POWER_RAND_LOW
);
.
value
(
"LITE_POWER_RAND_LOW"
,
PowerMode
::
LITE_POWER_RAND_LOW
);
}
}
void
BindLiteMLUCoreVersion
(
py
::
module
*
m
)
{
py
::
enum_
<
MLUCoreVersion
>
(
*
m
,
"MLUCoreVersion"
)
.
value
(
"LITE_MLU_220"
,
MLUCoreVersion
::
MLU_220
)
.
value
(
"LITE_MLU_270"
,
MLUCoreVersion
::
MLU_270
);
}
void
BindLitePlace
(
py
::
module
*
m
)
{
void
BindLitePlace
(
py
::
module
*
m
)
{
// TargetType
// TargetType
py
::
enum_
<
TargetType
>
(
*
m
,
"TargetType"
)
py
::
enum_
<
TargetType
>
(
*
m
,
"TargetType"
)
...
@@ -155,9 +163,7 @@ void BindLitePlace(py::module *m) {
...
@@ -155,9 +163,7 @@ void BindLitePlace(py::module *m) {
.
value
(
"OpenCL"
,
TargetType
::
kOpenCL
)
.
value
(
"OpenCL"
,
TargetType
::
kOpenCL
)
.
value
(
"FPGA"
,
TargetType
::
kFPGA
)
.
value
(
"FPGA"
,
TargetType
::
kFPGA
)
.
value
(
"NPU"
,
TargetType
::
kNPU
)
.
value
(
"NPU"
,
TargetType
::
kNPU
)
#ifdef LITE_WITH_MLU
.
value
(
"MLU"
,
TargetType
::
kMLU
)
.
value
(
"MLU"
,
TargetType
::
kMLU
)
#endif
.
value
(
"Any"
,
TargetType
::
kAny
);
.
value
(
"Any"
,
TargetType
::
kAny
);
// PrecisionType
// PrecisionType
...
...
lite/tools/build_mlu.sh
浏览文件 @
2042a830
...
@@ -20,7 +20,6 @@ function print_usage {
...
@@ -20,7 +20,6 @@ function print_usage {
# readonly variables with default value
# readonly variables with default value
readonly
CMAKE_COMMON_OPTIONS
=
"-DWITH_LITE=ON
\
readonly
CMAKE_COMMON_OPTIONS
=
"-DWITH_LITE=ON
\
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF
\
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=OFF
\
-DWITH_PYTHON=OFF
\
-DLITE_WITH_ARM=OFF"
-DLITE_WITH_ARM=OFF"
readonly
NUM_CORES_FOR_COMPILE
=
${
LITE_BUILD_THREADS
:-
8
}
readonly
NUM_CORES_FOR_COMPILE
=
${
LITE_BUILD_THREADS
:-
8
}
...
@@ -71,6 +70,7 @@ function build_mlu {
...
@@ -71,6 +70,7 @@ function build_mlu {
-DLITE_WITH_X86
=
ON
\
-DLITE_WITH_X86
=
ON
\
-DWITH_MKL
=
ON
\
-DWITH_MKL
=
ON
\
-DLITE_WITH_MLU
=
ON
\
-DLITE_WITH_MLU
=
ON
\
-DLITE_WITH_PYTHON
=
ON
\
-DLITE_BUILD_EXTRA
=
${
BUILD_EXTRA
}
\
-DLITE_BUILD_EXTRA
=
${
BUILD_EXTRA
}
\
-DWITH_TESTING
=
${
WITH_TESTING
}
\
-DWITH_TESTING
=
${
WITH_TESTING
}
\
-DNEUWARE_HOME
=
${
NEUWARE_HOME
}
-DNEUWARE_HOME
=
${
NEUWARE_HOME
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录