Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
cdec7b64
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看板
提交
cdec7b64
编写于
11月 15, 2019
作者:
B
baolei.an
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. test = develop
2. [bm] finish build related files
上级
b07ad291
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
84 addition
and
12 deletion
+84
-12
cmake/bm.cmake
cmake/bm.cmake
+75
-0
lite/tools/build_bm.sh
lite/tools/build_bm.sh
+9
-12
未找到文件。
cmake/bm.cmake
0 → 100644
浏览文件 @
cdec7b64
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if
(
NOT LITE_WITH_BM
)
return
()
endif
()
if
(
NOT DEFINED BM_SDK_ROOT
)
set
(
BM_SDK_ROOT $ENV{BM_SDK_ROOT}
)
if
(
NOT BM_SDK_ROOT
)
message
(
FATAL_ERROR
"Must set BM_SDK_ROOT or env BM_SDK_ROOT when LITE_WITH_BM=ON"
)
endif
()
endif
()
message
(
STATUS
"BM_SDK_ROOT:
${
BM_SDK_ROOT
}
"
)
find_path
(
BM_SDK_INC NAMES bmruntime_interface.h
PATHS
${
BM_SDK_ROOT
}
/include/bmruntime NO_DEFAULT_PATH
)
if
(
NOT BM_SDK_INC
)
message
(
FATAL_ERROR
"Can not find bmruntime_interface.h in
${
BM_SDK_ROOT
}
/include"
)
endif
()
include_directories
(
"
${
BM_SDK_ROOT
}
/include"
)
include_directories
(
"
${
BM_SDK_ROOT
}
/include/bmruntime"
)
include_directories
(
"
${
BM_SDK_ROOT
}
/include/bmlib"
)
find_library
(
BM_SDK_RT_LIB NAMES bmrt
PATHS
${
BM_SDK_ROOT
}
/lib/app
)
if
(
NOT BM_SDK_RT_LIB
)
message
(
FATAL_ERROR
"Can not find bmrt Library in
${
BM_SDK_ROOT
}
"
)
else
()
message
(
STATUS
"Found bmrt Library:
${
BM_SDK_RT_LIB
}
"
)
add_library
(
bmrt SHARED IMPORTED GLOBAL
)
set_property
(
TARGET bmrt PROPERTY IMPORTED_LOCATION
${
BM_SDK_RT_LIB
}
)
endif
()
find_library
(
BM_SDK_BM_LIB NAMES bmlib
PATHS
${
BM_SDK_ROOT
}
/lib/app
)
if
(
NOT BM_SDK_BM_LIB
)
message
(
FATAL_ERROR
"Can not find bmlib Library in
${
BM_SDK_ROOT
}
"
)
else
()
message
(
STATUS
"Found bmlib Library:
${
BM_SDK_BM_LIB
}
"
)
add_library
(
bmlib SHARED IMPORTED GLOBAL
)
set_property
(
TARGET bmlib PROPERTY IMPORTED_LOCATION
${
BM_SDK_BM_LIB
}
)
endif
()
find_library
(
BM_SDK_COMPILER_LIB NAMES bmcompiler
PATHS
${
BM_SDK_ROOT
}
/lib/bmcompiler
)
if
(
NOT BM_SDK_COMPILER_LIB
)
message
(
FATAL_ERROR
"Can not find bmcompiler Library in
${
BM_SDK_ROOT
}
"
)
else
()
message
(
STATUS
"Found bmcompiler Library:
${
BM_SDK_COMPILER_LIB
}
"
)
add_library
(
bmcompiler SHARED IMPORTED GLOBAL
)
set_property
(
TARGET bmcompiler PROPERTY IMPORTED_LOCATION
${
BM_SDK_COMPILER_LIB
}
)
endif
()
find_library
(
BM_SDK_CPU_LIB NAMES bmcpu
PATHS
${
BM_SDK_ROOT
}
/lib/bmcpu
)
if
(
NOT BM_SDK_CPU_LIB
)
message
(
FATAL_ERROR
"Can not find bmcpu Library in
${
BM_SDK_ROOT
}
"
)
else
()
message
(
STATUS
"Found bmcpu Library:
${
BM_SDK_CPU_LIB
}
"
)
add_library
(
bmcpu SHARED IMPORTED GLOBAL
)
set_property
(
TARGET bmcpu PROPERTY IMPORTED_LOCATION
${
BM_SDK_CPU_LIB
}
)
endif
()
lite/tools/build_bm.sh
浏览文件 @
cdec7b64
...
...
@@ -2,10 +2,10 @@
set
-ex
# global variables with default value
XPU
_SDK_ROOT
=
"
$(
pwd
)
/../BM_SDK"
# BM SDK
TARGET_NAME
=
"
lite_compile_deps
"
# default target
BUILD_EXTRA
=
O
N
# ON(with sequence ops)/OFF
WITH_TESTING
=
O
N
# ON/OFF
BM
_SDK_ROOT
=
"
$(
pwd
)
/../BM_SDK"
# BM SDK
TARGET_NAME
=
"
BM1682
"
# default target
BUILD_EXTRA
=
O
FF
# ON(with sequence ops)/OFF
WITH_TESTING
=
O
FF
# ON/OFF
function
print_usage
{
echo
-e
"
\n
USAGE:"
...
...
@@ -23,7 +23,7 @@ readonly CMAKE_COMMON_OPTIONS="-DWITH_LITE=ON \
-DWITH_PYTHON=OFF
\
-DLITE_WITH_ARM=OFF"
readonly
NUM_CORES_FOR_COMPILE
=
${
LITE_BUILD_THREADS
:-
1
}
readonly
NUM_CORES_FOR_COMPILE
=
${
LITE_BUILD_THR
LITE_BUILD_THREADS
EADS
:-
1
}
readonly
THIRDPARTY_TAR
=
https://paddle-inference-dist.bj.bcebos.com/PaddleLite/third-party-05b862.tar.gz
readonly
workspace
=
$(
pwd
)
...
...
@@ -74,8 +74,9 @@ function build_bm {
-DWITH_MKL
=
OFF
\
-DLITE_BUILD_EXTRA
=
OFF
\
-DLITE_WITH_XPU
=
OFF
\
-DLITE_WITH_BM
=
ON
\
-DWITH_TESTING
=
${
WITH_TESTING
}
\
-D
XPU_SDK_ROOT
=
${
XPU
_SDK_ROOT
}
-D
BM_SDK_ROOT
=
${
BM
_SDK_ROOT
}
make
$TARGET_NAME
-j
$NUM_CORES_FOR_COMPILE
...
...
@@ -91,15 +92,11 @@ function main {
TARGET_NAME
=
"
${
i
#*=
}
"
shift
;;
--build_extra
=
*
)
BUILD_EXTRA
=
"
${
i
#*=
}
"
shift
;;
--xpu_sdk_root
=
*
)
--bm_sdk_root
=
*
)
BM_SDK_ROOT
=
"
${
i
#*=
}
"
shift
;;
b
uild
)
b
m
)
build_bm
shift
;;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录