Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
9ba8fd8e
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看板
未验证
提交
9ba8fd8e
编写于
3月 16, 2020
作者:
H
hong19860320
提交者:
GitHub
3月 16, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[XPU][NPU] Support XPU on AArch64 for FT+Kylin (#3184)
上级
a6f9e0c7
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
91 addition
and
50 deletion
+91
-50
CMakeLists.txt
CMakeLists.txt
+3
-2
cmake/device/npu.cmake
cmake/device/npu.cmake
+14
-13
cmake/device/xpu.cmake
cmake/device/xpu.cmake
+21
-22
lite/CMakeLists.txt
lite/CMakeLists.txt
+3
-0
lite/core/mir/type_precision_cast_pass.cc
lite/core/mir/type_precision_cast_pass.cc
+9
-8
lite/kernels/xpu/subgraph_compute.cc
lite/kernels/xpu/subgraph_compute.cc
+5
-3
lite/kernels/xpu/subgraph_compute.h
lite/kernels/xpu/subgraph_compute.h
+1
-1
lite/tools/build.sh
lite/tools/build.sh
+35
-1
未找到文件。
CMakeLists.txt
浏览文件 @
9ba8fd8e
...
@@ -132,7 +132,8 @@ endif()
...
@@ -132,7 +132,8 @@ endif()
if
(
WITH_LITE AND LITE_WITH_LIGHT_WEIGHT_FRAMEWORK
)
if
(
WITH_LITE AND LITE_WITH_LIGHT_WEIGHT_FRAMEWORK
)
message
(
STATUS
"Building the mobile framework"
)
message
(
STATUS
"Building the mobile framework"
)
include
(
cross_compiling/postproject
)
include
(
cross_compiling/postproject
)
include
(
cross_compiling/npu
)
# check and prepare NPU DDK
include
(
device/npu
)
# check and prepare NPU DDK
include
(
device/xpu
)
# check and prepare XPU SDK
# We compile the mobile deployment library when LITE_ON_TINY_PUBLISH=ON
# We compile the mobile deployment library when LITE_ON_TINY_PUBLISH=ON
# So the following third party dependencies are not needed.
# So the following third party dependencies are not needed.
...
@@ -173,7 +174,7 @@ endif()
...
@@ -173,7 +174,7 @@ endif()
########################################################################################
########################################################################################
if
(
LITE_WITH_XPU
)
if
(
LITE_WITH_XPU
)
include
(
xpu
)
include
(
device/
xpu
)
endif
()
endif
()
include
(
external/mklml
)
# download mklml package
include
(
external/mklml
)
# download mklml package
...
...
cmake/
cross_compiling
/npu.cmake
→
cmake/
device
/npu.cmake
浏览文件 @
9ba8fd8e
...
@@ -17,15 +17,16 @@ if(NOT LITE_WITH_NPU)
...
@@ -17,15 +17,16 @@ if(NOT LITE_WITH_NPU)
endif
()
endif
()
if
(
NOT DEFINED NPU_DDK_ROOT
)
if
(
NOT DEFINED NPU_DDK_ROOT
)
set
(
NPU_DDK_ROOT $ENV{NPU_DDK_ROOT}
)
set
(
NPU_DDK_ROOT $ENV{NPU_DDK_ROOT}
)
if
(
NOT NPU_DDK_ROOT
)
if
(
NOT NPU_DDK_ROOT
)
message
(
FATAL_ERROR
"Must set NPU_DDK_ROOT or env NPU_DDK_ROOT when LITE_WITH_NPU=ON"
)
message
(
FATAL_ERROR
"Must set NPU_DDK_ROOT or env NPU_DDK_ROOT when LITE_WITH_NPU=ON"
)
endif
()
endif
()
endif
()
endif
()
message
(
STATUS
"NPU_DDK_ROOT:
${
NPU_DDK_ROOT
}
"
)
message
(
STATUS
"NPU_DDK_ROOT:
${
NPU_DDK_ROOT
}
"
)
find_path
(
NPU_DDK_INC NAMES HiAiModelManagerService.h
find_path
(
NPU_DDK_INC NAMES HiAiModelManagerService.h
PATHS
${
NPU_DDK_ROOT
}
/include NO_DEFAULT_PATH
)
PATHS
${
NPU_DDK_ROOT
}
/include
NO_DEFAULT_PATH
)
if
(
NOT NPU_DDK_INC
)
if
(
NOT NPU_DDK_INC
)
message
(
FATAL_ERROR
"Can not find HiAiModelManagerService.h in
${
NPU_DDK_ROOT
}
/include"
)
message
(
FATAL_ERROR
"Can not find HiAiModelManagerService.h in
${
NPU_DDK_ROOT
}
/include"
)
endif
()
endif
()
...
@@ -34,21 +35,24 @@ include_directories("${NPU_DDK_ROOT}/include")
...
@@ -34,21 +35,24 @@ include_directories("${NPU_DDK_ROOT}/include")
set
(
NPU_SUB_LIB_PATH
"lib64"
)
set
(
NPU_SUB_LIB_PATH
"lib64"
)
if
(
ARM_TARGET_ARCH_ABI STREQUAL
"armv8"
)
if
(
ARM_TARGET_ARCH_ABI STREQUAL
"armv8"
)
set
(
NPU_SUB_LIB_PATH
"lib64"
)
set
(
NPU_SUB_LIB_PATH
"lib64"
)
endif
()
endif
()
if
(
ARM_TARGET_ARCH_ABI STREQUAL
"armv7"
)
if
(
ARM_TARGET_ARCH_ABI STREQUAL
"armv7"
)
set
(
NPU_SUB_LIB_PATH
"lib"
)
set
(
NPU_SUB_LIB_PATH
"lib"
)
endif
()
endif
()
find_library
(
NPU_DDK_HIAI_FILE NAMES hiai
find_library
(
NPU_DDK_HIAI_FILE NAMES hiai
PATHS
${
NPU_DDK_ROOT
}
/
${
NPU_SUB_LIB_PATH
}
)
PATHS
${
NPU_DDK_ROOT
}
/
${
NPU_SUB_LIB_PATH
}
NO_DEFAULT_PATH
)
find_library
(
NPU_DDK_IR_FILE NAMES hiai_ir
find_library
(
NPU_DDK_IR_FILE NAMES hiai_ir
PATHS
${
NPU_DDK_ROOT
}
/
${
NPU_SUB_LIB_PATH
}
)
PATHS
${
NPU_DDK_ROOT
}
/
${
NPU_SUB_LIB_PATH
}
NO_DEFAULT_PATH
)
find_library
(
NPU_DDK_IR_BUILD_FILE NAMES hiai_ir_build
find_library
(
NPU_DDK_IR_BUILD_FILE NAMES hiai_ir_build
PATHS
${
NPU_DDK_ROOT
}
/
${
NPU_SUB_LIB_PATH
}
)
PATHS
${
NPU_DDK_ROOT
}
/
${
NPU_SUB_LIB_PATH
}
NO_DEFAULT_PATH
)
if
(
NOT NPU_DDK_HIAI_FILE
)
if
(
NOT NPU_DDK_HIAI_FILE
)
message
(
FATAL_ERROR
"Can not find NPU_DDK_HIAI_FILE in
${
NPU_DDK_ROOT
}
"
)
message
(
FATAL_ERROR
"Can not find NPU_DDK_HIAI_FILE in
${
NPU_DDK_ROOT
}
"
)
...
@@ -76,6 +80,3 @@ endif()
...
@@ -76,6 +80,3 @@ endif()
set
(
npu_runtime_libs npu_ddk_hiai CACHE INTERNAL
"npu ddk runtime libs"
)
set
(
npu_runtime_libs npu_ddk_hiai CACHE INTERNAL
"npu ddk runtime libs"
)
set
(
npu_builder_libs npu_ddk_ir npu_ddk_ir_build CACHE INTERNAL
"npu ddk builder libs"
)
set
(
npu_builder_libs npu_ddk_ir npu_ddk_ir_build CACHE INTERNAL
"npu ddk builder libs"
)
cmake/xpu.cmake
→
cmake/
device/
xpu.cmake
浏览文件 @
9ba8fd8e
...
@@ -17,15 +17,16 @@ if(NOT LITE_WITH_XPU)
...
@@ -17,15 +17,16 @@ if(NOT LITE_WITH_XPU)
endif
()
endif
()
if
(
NOT DEFINED XPU_SDK_ROOT
)
if
(
NOT DEFINED XPU_SDK_ROOT
)
set
(
XPU_SDK_ROOT $ENV{XPU_SDK_ROOT}
)
set
(
XPU_SDK_ROOT $ENV{XPU_SDK_ROOT}
)
if
(
NOT XPU_SDK_ROOT
)
if
(
NOT XPU_SDK_ROOT
)
message
(
FATAL_ERROR
"Must set XPU_SDK_ROOT or env XPU_SDK_ROOT when LITE_WITH_XPU=ON"
)
message
(
FATAL_ERROR
"Must set XPU_SDK_ROOT or env XPU_SDK_ROOT when LITE_WITH_XPU=ON"
)
endif
()
endif
()
endif
()
endif
()
message
(
STATUS
"XPU_SDK_ROOT:
${
XPU_SDK_ROOT
}
"
)
message
(
STATUS
"XPU_SDK_ROOT:
${
XPU_SDK_ROOT
}
"
)
find_path
(
XPU_SDK_INC NAMES xtcl.h
find_path
(
XPU_SDK_INC NAMES xtcl.h
PATHS
${
XPU_SDK_ROOT
}
/XTCL/include/xtcl NO_DEFAULT_PATH
)
PATHS
${
XPU_SDK_ROOT
}
/XTCL/include/xtcl
NO_DEFAULT_PATH
)
if
(
NOT XPU_SDK_INC
)
if
(
NOT XPU_SDK_INC
)
message
(
FATAL_ERROR
"Can not find xtcl.h in
${
XPU_SDK_ROOT
}
/include"
)
message
(
FATAL_ERROR
"Can not find xtcl.h in
${
XPU_SDK_ROOT
}
/include"
)
endif
()
endif
()
...
@@ -34,7 +35,8 @@ include_directories("${XPU_SDK_ROOT}/XTCL/include")
...
@@ -34,7 +35,8 @@ include_directories("${XPU_SDK_ROOT}/XTCL/include")
include_directories
(
"
${
XPU_SDK_ROOT
}
/XTDK/include"
)
include_directories
(
"
${
XPU_SDK_ROOT
}
/XTDK/include"
)
find_library
(
XPU_SDK_XTCL_FILE NAMES xtcl
find_library
(
XPU_SDK_XTCL_FILE NAMES xtcl
PATHS
${
XPU_SDK_ROOT
}
/XTCL/so
)
PATHS
${
XPU_SDK_ROOT
}
/XTCL/so
NO_DEFAULT_PATH
)
if
(
NOT XPU_SDK_XTCL_FILE
)
if
(
NOT XPU_SDK_XTCL_FILE
)
message
(
FATAL_ERROR
"Can not find XPU XTCL Library in
${
XPU_SDK_ROOT
}
"
)
message
(
FATAL_ERROR
"Can not find XPU XTCL Library in
${
XPU_SDK_ROOT
}
"
)
...
@@ -45,7 +47,8 @@ else()
...
@@ -45,7 +47,8 @@ else()
endif
()
endif
()
find_library
(
XPU_SDK_TVM_FILE NAMES tvm
find_library
(
XPU_SDK_TVM_FILE NAMES tvm
PATHS
${
XPU_SDK_ROOT
}
/XTCL/so
)
PATHS
${
XPU_SDK_ROOT
}
/XTCL/so
NO_DEFAULT_PATH
)
if
(
NOT XPU_SDK_TVM_FILE
)
if
(
NOT XPU_SDK_TVM_FILE
)
message
(
FATAL_ERROR
"Can not find XPU TVM Library in
${
XPU_SDK_ROOT
}
"
)
message
(
FATAL_ERROR
"Can not find XPU TVM Library in
${
XPU_SDK_ROOT
}
"
)
...
@@ -56,7 +59,8 @@ else()
...
@@ -56,7 +59,8 @@ else()
endif
()
endif
()
find_library
(
XPU_SDK_XPU_API_FILE NAMES xpuapi
find_library
(
XPU_SDK_XPU_API_FILE NAMES xpuapi
PATHS
${
XPU_SDK_ROOT
}
/XTDK/shlib
)
PATHS
${
XPU_SDK_ROOT
}
/XTDK/shlib
NO_DEFAULT_PATH
)
if
(
NOT XPU_SDK_XPU_API_FILE
)
if
(
NOT XPU_SDK_XPU_API_FILE
)
message
(
FATAL_ERROR
"Can not find XPU API Library in
${
XPU_SDK_ROOT
}
"
)
message
(
FATAL_ERROR
"Can not find XPU API Library in
${
XPU_SDK_ROOT
}
"
)
...
@@ -67,7 +71,8 @@ else()
...
@@ -67,7 +71,8 @@ else()
endif
()
endif
()
find_library
(
XPU_SDK_XPU_RT_FILE NAMES xpurt
find_library
(
XPU_SDK_XPU_RT_FILE NAMES xpurt
PATHS
${
XPU_SDK_ROOT
}
/XTDK/shlib
)
PATHS
${
XPU_SDK_ROOT
}
/XTDK/shlib
NO_DEFAULT_PATH
)
if
(
NOT XPU_SDK_XPU_RT_FILE
)
if
(
NOT XPU_SDK_XPU_RT_FILE
)
message
(
FATAL_ERROR
"Can not find XPU RT Library in
${
XPU_SDK_ROOT
}
"
)
message
(
FATAL_ERROR
"Can not find XPU RT Library in
${
XPU_SDK_ROOT
}
"
)
...
@@ -78,18 +83,12 @@ else()
...
@@ -78,18 +83,12 @@ else()
endif
()
endif
()
find_library
(
XPU_SDK_XPU_JITC_FILE NAMES xpujitc
find_library
(
XPU_SDK_XPU_JITC_FILE NAMES xpujitc
PATHS
${
XPU_SDK_ROOT
}
/XTDK/shlib
)
PATHS
${
XPU_SDK_ROOT
}
/XTDK/shlib
NO_DEFAULT_PATH
)
if
(
NOT XPU_SDK_XPU_JITC_FILE
)
message
(
FATAL_ERROR
"Can not find XPU JITC Library in
${
XPU_SDK_ROOT
}
"
)
else
()
message
(
STATUS
"Found XPU JITC Library:
${
XPU_SDK_XPU_JITC_FILE
}
"
)
add_library
(
xpu_sdk_xpu_jitc SHARED IMPORTED GLOBAL
)
set_property
(
TARGET xpu_sdk_xpu_jitc PROPERTY IMPORTED_LOCATION
${
XPU_SDK_XPU_JITC_FILE
}
)
endif
()
find_library
(
XPU_SDK_LLVM_FILE NAMES LLVM-8
find_library
(
XPU_SDK_LLVM_FILE NAMES LLVM-8
PATHS
${
XPU_SDK_ROOT
}
/XTDK/shlib
)
PATHS
${
XPU_SDK_ROOT
}
/XTDK/shlib
NO_DEFAULT_PATH
)
if
(
NOT XPU_SDK_LLVM_FILE
)
if
(
NOT XPU_SDK_LLVM_FILE
)
message
(
FATAL_ERROR
"Can not find LLVM Library in
${
XPU_SDK_ROOT
}
"
)
message
(
FATAL_ERROR
"Can not find LLVM Library in
${
XPU_SDK_ROOT
}
"
)
...
@@ -99,7 +98,7 @@ else()
...
@@ -99,7 +98,7 @@ else()
set_property
(
TARGET xpu_sdk_llvm PROPERTY IMPORTED_LOCATION
${
XPU_SDK_LLVM_FILE
}
)
set_property
(
TARGET xpu_sdk_llvm PROPERTY IMPORTED_LOCATION
${
XPU_SDK_LLVM_FILE
}
)
endif
()
endif
()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DDMLC_USE_GLOG=
1 -D_GLIBCXX_USE_CXX11_ABI=
0"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DDMLC_USE_GLOG=0"
)
set
(
xpu_runtime_libs xpu_sdk_xtcl xpu_sdk_tvm xpu_sdk_xpu_api xpu_sdk_xpu_rt xpu_sdk_
xpu_jitc xpu_sdk_
llvm CACHE INTERNAL
"xpu runtime libs"
)
set
(
xpu_runtime_libs xpu_sdk_xtcl xpu_sdk_tvm xpu_sdk_xpu_api xpu_sdk_xpu_rt xpu_sdk_llvm CACHE INTERNAL
"xpu runtime libs"
)
set
(
xpu_builder_libs xpu_sdk_xtcl xpu_sdk_tvm xpu_sdk_xpu_api xpu_sdk_xpu_rt xpu_sdk_
xpu_jitc xpu_sdk_
llvm CACHE INTERNAL
"xpu builder libs"
)
set
(
xpu_builder_libs xpu_sdk_xtcl xpu_sdk_tvm xpu_sdk_xpu_api xpu_sdk_xpu_rt xpu_sdk_llvm CACHE INTERNAL
"xpu builder libs"
)
lite/CMakeLists.txt
浏览文件 @
9ba8fd8e
...
@@ -65,6 +65,9 @@ if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND LITE_WITH_ARM)
...
@@ -65,6 +65,9 @@ if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND LITE_WITH_ARM)
if
(
LITE_WITH_NPU
)
if
(
LITE_WITH_NPU
)
set
(
INFER_LITE_PUBLISH_ROOT
"
${
INFER_LITE_PUBLISH_ROOT
}
.npu"
)
set
(
INFER_LITE_PUBLISH_ROOT
"
${
INFER_LITE_PUBLISH_ROOT
}
.npu"
)
endif
(
LITE_WITH_NPU
)
endif
(
LITE_WITH_NPU
)
if
(
LITE_WITH_XPU
)
set
(
INFER_LITE_PUBLISH_ROOT
"
${
INFER_LITE_PUBLISH_ROOT
}
.xpu"
)
endif
(
LITE_WITH_XPU
)
if
(
LITE_WITH_FPGA
)
if
(
LITE_WITH_FPGA
)
set
(
INFER_LITE_PUBLISH_ROOT
"
${
INFER_LITE_PUBLISH_ROOT
}
.fpga"
)
set
(
INFER_LITE_PUBLISH_ROOT
"
${
INFER_LITE_PUBLISH_ROOT
}
.fpga"
)
endif
(
LITE_WITH_FPGA
)
endif
(
LITE_WITH_FPGA
)
...
...
lite/core/mir/type_precision_cast_pass.cc
浏览文件 @
9ba8fd8e
...
@@ -71,21 +71,22 @@ static bool InferScaleFromSubgraph(std::string var_name,
...
@@ -71,21 +71,22 @@ static bool InferScaleFromSubgraph(std::string var_name,
const
OpInfo
*
op_info
,
const
OpInfo
*
op_info
,
float
*
scale
,
float
*
scale
,
bool
reverse
=
false
)
{
bool
reverse
=
false
)
{
bool
found
=
false
;
std
::
string
attr_name
=
reverse
?
"output_data_names"
:
"input_data_names"
;
auto
input_or_output_names
=
op_info
->
GetAttr
<
std
::
vector
<
std
::
string
>>
(
if
(
!
op_info
->
HasAttr
(
attr_name
))
return
false
;
reverse
?
"output_data_names"
:
"input_data_names"
);
auto
input_or_output_names
=
auto
input_or_output_scales
=
op_info
->
GetAttr
<
std
::
vector
<
float
>>
(
op_info
->
GetAttr
<
std
::
vector
<
std
::
string
>>
(
attr_name
);
reverse
?
"output_data_scales"
:
"input_data_scales"
);
attr_name
=
reverse
?
"output_data_scales"
:
"input_data_scales"
;
if
(
!
op_info
->
HasAttr
(
attr_name
))
return
false
;
auto
input_or_output_scales
=
op_info
->
GetAttr
<
std
::
vector
<
float
>>
(
attr_name
);
auto
size
=
input_or_output_names
.
size
();
auto
size
=
input_or_output_names
.
size
();
CHECK
(
size
==
input_or_output_scales
.
size
());
CHECK
(
size
==
input_or_output_scales
.
size
());
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
if
(
input_or_output_names
[
i
]
==
var_name
)
{
if
(
input_or_output_names
[
i
]
==
var_name
)
{
*
scale
=
input_or_output_scales
[
i
];
*
scale
=
input_or_output_scales
[
i
];
found
=
true
;
return
true
;
break
;
}
}
}
}
return
f
ound
;
return
f
alse
;
}
}
// Infer the scale value for the new calib op from the input_scale of the
// Infer the scale value for the new calib op from the input_scale of the
...
...
lite/kernels/xpu/subgraph_compute.cc
浏览文件 @
9ba8fd8e
...
@@ -220,10 +220,12 @@ void SubgraphCompute::Run() {
...
@@ -220,10 +220,12 @@ void SubgraphCompute::Run() {
REGISTER_LITE_KERNEL
(
subgraph
,
REGISTER_LITE_KERNEL
(
subgraph
,
kXPU
,
kXPU
,
k
Float
,
k
Any
,
kNCHW
,
kNCHW
,
paddle
::
lite
::
kernels
::
xpu
::
SubgraphCompute
,
paddle
::
lite
::
kernels
::
xpu
::
SubgraphCompute
,
def
)
def
)
.
BindInput
(
"Inputs"
,
{
LiteType
::
GetTensorTy
(
TARGET
(
kHost
))})
.
BindInput
(
"Inputs"
,
.
BindOutput
(
"Outputs"
,
{
LiteType
::
GetTensorTy
(
TARGET
(
kHost
))})
{
LiteType
::
GetTensorTy
(
TARGET
(
kHost
),
PRECISION
(
kAny
))})
.
BindOutput
(
"Outputs"
,
{
LiteType
::
GetTensorTy
(
TARGET
(
kHost
),
PRECISION
(
kAny
))})
.
Finalize
();
.
Finalize
();
lite/kernels/xpu/subgraph_compute.h
浏览文件 @
9ba8fd8e
...
@@ -49,7 +49,7 @@ class SubgraphEngine : public subgraph::Engine {
...
@@ -49,7 +49,7 @@ class SubgraphEngine : public subgraph::Engine {
std
::
unique_ptr
<
xtcl
::
network
::
xRuntimeInstance
>
device_program_
{
nullptr
};
std
::
unique_ptr
<
xtcl
::
network
::
xRuntimeInstance
>
device_program_
{
nullptr
};
};
};
class
SubgraphCompute
:
public
KernelLite
<
TARGET
(
kXPU
),
PRECISION
(
k
Float
)
>
{
class
SubgraphCompute
:
public
KernelLite
<
TARGET
(
kXPU
),
PRECISION
(
k
Any
)
>
{
public:
public:
using
param_t
=
operators
::
SubgraphParam
;
using
param_t
=
operators
::
SubgraphParam
;
...
...
lite/tools/build.sh
浏览文件 @
9ba8fd8e
...
@@ -21,6 +21,10 @@ OPTMODEL_DIR=""
...
@@ -21,6 +21,10 @@ OPTMODEL_DIR=""
BUILD_TAILOR
=
OFF
BUILD_TAILOR
=
OFF
BUILD_CV
=
OFF
BUILD_CV
=
OFF
SHUTDOWN_LOG
=
ON
SHUTDOWN_LOG
=
ON
BUILD_NPU
=
OFF
NPU_DDK_ROOT
=
"
$(
pwd
)
/ai_ddk_lib/"
# Download HiAI DDK from https://developer.huawei.com/consumer/cn/hiai/
BUILD_XPU
=
OFF
XPU_SDK_ROOT
=
"
$(
pwd
)
/xpu_sdk_lib/"
LITE_WITH_ARM_LANG
=
OFF
LITE_WITH_ARM_LANG
=
OFF
readonly
THIRDPARTY_TAR
=
https://paddle-inference-dist.bj.bcebos.com/PaddleLite/third-party-05b862.tar.gz
readonly
THIRDPARTY_TAR
=
https://paddle-inference-dist.bj.bcebos.com/PaddleLite/third-party-05b862.tar.gz
...
@@ -130,6 +134,10 @@ function make_tiny_publish_so {
...
@@ -130,6 +134,10 @@ function make_tiny_publish_so {
-DLITE_WITH_ARM_LANG
=
$LITE_WITH_ARM_LANG
\
-DLITE_WITH_ARM_LANG
=
$LITE_WITH_ARM_LANG
\
-DLITE_BUILD_TAILOR
=
$BUILD_TAILOR
\
-DLITE_BUILD_TAILOR
=
$BUILD_TAILOR
\
-DLITE_OPTMODEL_DIR
=
$OPTMODEL_DIR
\
-DLITE_OPTMODEL_DIR
=
$OPTMODEL_DIR
\
-DLITE_WITH_NPU
=
$BUILD_NPU
\
-DNPU_DDK_ROOT
=
$NPU_DDK_ROOT
\
-DLITE_WITH_XPU
=
$BUILD_XPU
\
-DXPU_SDK_ROOT
=
$XPU_SDK_ROOT
\
-DARM_TARGET_OS
=
${
os
}
-DARM_TARGET_ARCH_ABI
=
${
abi
}
-DARM_TARGET_LANG
=
${
lang
}
-DARM_TARGET_OS
=
${
os
}
-DARM_TARGET_ARCH_ABI
=
${
abi
}
-DARM_TARGET_LANG
=
${
lang
}
make publish_inference
-j
$NUM_PROC
make publish_inference
-j
$NUM_PROC
...
@@ -214,6 +222,10 @@ function make_full_publish_so {
...
@@ -214,6 +222,10 @@ function make_full_publish_so {
-DLITE_WITH_ARM_LANG
=
$LITE_WITH_ARM_LANG
\
-DLITE_WITH_ARM_LANG
=
$LITE_WITH_ARM_LANG
\
-DLITE_BUILD_TAILOR
=
$BUILD_TAILOR
\
-DLITE_BUILD_TAILOR
=
$BUILD_TAILOR
\
-DLITE_OPTMODEL_DIR
=
$OPTMODEL_DIR
\
-DLITE_OPTMODEL_DIR
=
$OPTMODEL_DIR
\
-DLITE_WITH_NPU
=
$BUILD_NPU
\
-DNPU_DDK_ROOT
=
$NPU_DDK_ROOT
\
-DLITE_WITH_XPU
=
$BUILD_XPU
\
-DXPU_SDK_ROOT
=
$XPU_SDK_ROOT
\
-DARM_TARGET_OS
=
${
os
}
-DARM_TARGET_ARCH_ABI
=
${
abi
}
-DARM_TARGET_LANG
=
${
lang
}
-DARM_TARGET_OS
=
${
os
}
-DARM_TARGET_ARCH_ABI
=
${
abi
}
-DARM_TARGET_LANG
=
${
lang
}
make publish_inference
-j
$NUM_PROC
make publish_inference
-j
$NUM_PROC
...
@@ -243,6 +255,10 @@ function make_all_tests {
...
@@ -243,6 +255,10 @@ function make_all_tests {
-DLITE_BUILD_EXTRA
=
$BUILD_EXTRA
\
-DLITE_BUILD_EXTRA
=
$BUILD_EXTRA
\
-DLITE_WITH_CV
=
$BUILD_CV
\
-DLITE_WITH_CV
=
$BUILD_CV
\
-DLITE_WITH_ARM_LANG
=
$LITE_WITH_ARM_LANG
\
-DLITE_WITH_ARM_LANG
=
$LITE_WITH_ARM_LANG
\
-DLITE_WITH_NPU
=
$BUILD_NPU
\
-DNPU_DDK_ROOT
=
$NPU_DDK_ROOT
\
-DLITE_WITH_XPU
=
$BUILD_XPU
\
-DXPU_SDK_ROOT
=
$XPU_SDK_ROOT
\
-DARM_TARGET_OS
=
${
os
}
-DARM_TARGET_ARCH_ABI
=
${
abi
}
-DARM_TARGET_LANG
=
${
lang
}
-DARM_TARGET_OS
=
${
os
}
-DARM_TARGET_ARCH_ABI
=
${
abi
}
-DARM_TARGET_LANG
=
${
lang
}
make lite_compile_deps
-j
$NUM_PROC
make lite_compile_deps
-j
$NUM_PROC
...
@@ -339,7 +355,9 @@ function make_x86 {
...
@@ -339,7 +355,9 @@ function make_x86 {
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
OFF
\
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
OFF
\
-DLITE_WITH_ARM
=
OFF
\
-DLITE_WITH_ARM
=
OFF
\
-DWITH_GPU
=
OFF
\
-DWITH_GPU
=
OFF
\
-DLITE_BUILD_EXTRA
=
ON
-DLITE_BUILD_EXTRA
=
ON
\
-DLITE_WITH_XPU
=
$BUID_XPU
\
-DXPU_SDK_ROOT
=
$XPU_SDK_ROOT
\
make publish_inference
-j
$NUM_PROC
make publish_inference
-j
$NUM_PROC
cd
-
cd
-
...
@@ -441,6 +459,22 @@ function main {
...
@@ -441,6 +459,22 @@ function main {
SHUTDOWN_LOG
=
"
${
i
#*=
}
"
SHUTDOWN_LOG
=
"
${
i
#*=
}
"
shift
shift
;;
;;
--build_npu
=
*
)
BUILD_NPU
=
"
${
i
#*=
}
"
shift
;;
--npu_ddk_root
=
*
)
NPU_DDK_ROOT
=
"
${
i
#*=
}
"
shift
;;
--build_xpu
=
*
)
BUILD_XPU
=
"
${
i
#*=
}
"
shift
;;
--xpu_sdk_root
=
*
)
XPU_SDK_ROOT
=
"
${
i
#*=
}
"
shift
;;
tiny_publish
)
tiny_publish
)
make_tiny_publish_so
$ARM_OS
$ARM_ABI
$ARM_LANG
$ANDROID_STL
make_tiny_publish_so
$ARM_OS
$ARM_ABI
$ARM_LANG
$ANDROID_STL
shift
shift
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录