未验证 提交 ee5681f7 编写于 作者: W Wangzheee 提交者: GitHub

[CI][LITE][BM]Add the implementation of CI for BM1682 and add the demo for...

[CI][LITE][BM]Add the implementation of CI for BM1682 and add the demo for BM1682. test=develop (#4217)

* [CI][LITE][BM]Add the implementation of CI for BM1682 and add the demo for BM1682. test=develop
上级 394c2833
......@@ -447,3 +447,19 @@ if (ARM_TARGET_OS STREQUAL "armlinux")
)
add_dependencies(publish_inference publish_inference_armlinux_cxx_demos)
endif()
if (LITE_WITH_BM)
add_custom_target(publish_inference_bm1682_cxx_demos ${TARGET}
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/demo/cxx"
COMMAND cp -r "${CMAKE_SOURCE_DIR}/lite/demo/cxx/bm_demo" "${INFER_LITE_PUBLISH_ROOT}/demo/cxx"
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/demo/cxx/bm_demo/lib"
COMMAND mkdir -p "${INFER_LITE_PUBLISH_ROOT}/demo/cxx/bm_demo/include"
COMMAND cp -r "${CMAKE_BINARY_DIR}/lite/api/libpaddle_full_api_shared.so" "${INFER_LITE_PUBLISH_ROOT}/demo/cxx/bm_demo/lib"
COMMAND cp -r "${CMAKE_SOURCE_DIR}/third-party/bmlibs/bm_sc3_libs/lib/bmcompiler" "${INFER_LITE_PUBLISH_ROOT}/demo/cxx/bm_demo/lib"
COMMAND cp -r "${CMAKE_SOURCE_DIR}/third-party/bmlibs/bm_sc3_libs/lib/bmnn/pcie" "${INFER_LITE_PUBLISH_ROOT}/demo/cxx/bm_demo/lib"
COMMAND cp -r "${CMAKE_SOURCE_DIR}/lite/api/paddle_place.h" "${INFER_LITE_PUBLISH_ROOT}/demo/cxx/bm_demo/include"
COMMAND cp -r "${CMAKE_SOURCE_DIR}/lite/api/paddle_api.h" "${INFER_LITE_PUBLISH_ROOT}/demo/cxx/bm_demo/include"
)
add_dependencies(publish_inference_bm1682_cxx_demos paddle_full_api_shared)
add_dependencies(publish_inference publish_inference_bm1682_cxx_demos)
endif()
mkdir ./build
cd ./build
cmake ..
make
cd ..
rm -rf ./build
mkdir ./build
cd ./build
cmake ..
make
cd ..
rm -rf ./build
mkdir ./build
cd ./build
cmake ..
make
cd ..
rm -rf ./build
wget http://paddle-inference-dist.bj.bcebos.com/mobilenet_v1.tar.gz
tar -xvf mobilenet_v1.tar.gz
mkdir ./lib
cp -r /paddlelite/build.lite.bm/lite/api/libpaddle_full_api_shared.so \
/paddlelite/third-party/bmlibs/bm_sc3_libs/lib/bmcompiler \
/paddlelite/third-party/bmlibs/bm_sc3_libs/lib/bmnn/pcie ./lib
mkdir ./include
cp -r /paddlelite/lite/api/paddle_place.h /paddlelite/lite/api/paddle_api.h ./include
mkdir ./build
cd ./build
cmake ..
make
cd ..
rm -rf ./build
rm -rf ./mobilenet_v1.tar.gz
./mobilenet_full_api ./mobilenet_v1 224 224
......@@ -90,7 +90,7 @@ function build_bm {
-DWITH_TESTING=${WITH_TESTING} \
-DBM_SDK_ROOT=${BM_SDK_ROOT}
make -j$NUM_CORES_FOR_COMPILE
make publish_inference -j$NUM_CORES_FOR_COMPILE
cd -
echo "Done"
......
#!/bin/bash
# The git version of CI is 2.7.4. This script is not compatible with git version 1.7.1.
set -ex
# Build the code with test=off. This is executed in the CI system.
function bm1682_buid {
cd /paddlelite
lite/tools/build_bm.sh --target_name=BM1682 --test=OFF
}
# Build and run bm1682 tests. This is executed in the CI system.
function bm1682_test {
cd /paddlelite/build.lite.bm/inference_lite_lib/demo/cxx/bm_1682_demo
wget http://paddle-inference-dist.bj.bcebos.com/mobilenet_v1.tar.gz
tar -xvf mobilenet_v1.tar.gz
build.sh
mobilenet_full_api mobilenet_v1 224 224
}
function main {
# Parse command line.
for i in "$@"; do
case $i in
ci_bm1682)
bm1682_buid
bm1682_test
shift
;;
*)
# unknown option
print_usage
exit 1
;;
esac
done
}
main $@
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册