未验证 提交 875daa4d 编写于 作者: S Santa An 提交者: GitHub

* support download bm_sdk, test=develop (#3093)

上级 f6e09aaf
......@@ -25,7 +25,11 @@ void Graph::AddNode(const std::string& name) {
}
void Graph::CreateCompilerHandle() {
#ifdef BM1682
compiler_handle_ = create_bmcompiler("BM1682");
#else
compiler_handle_ = create_bmcompiler("BM1684");
#endif
CHECK(compiler_handle_ != nullptr);
}
......
......@@ -34,7 +34,6 @@ int SubgraphEngine::BuildDeviceProgram() {
const auto& bridges = subgraph::Registry::Instance();
graph.CreateCompilerHandle();
auto& ctx = this->ctx_->template As<BMContext>();
int kk = 0;
for (auto& inst : origin_program_) {
auto op = inst.op();
CHECK(op);
......
......@@ -56,12 +56,11 @@ int Engine::BuildOriginProgram() {
} else {
VLOG(3) << "The attr '" << kKernelTypeAttr
<< "' not found, pick the first kernel for " << op_type;
std::vector<std::unique_ptr<KernelBase>> kernels;
#if defined(LITE_WITH_ARM)
auto kernels =
op->CreateKernels({Place{TARGET(kARM)}, Place{TARGET(kHost)}});
kernels = op->CreateKernels({Place{TARGET(kARM)}, Place{TARGET(kHost)}});
#elif defined(LITE_WITH_X86)
auto kernels =
op->CreateKernels({Place{TARGET(kX86)}, Place{TARGET(kHost)}});
kernels = op->CreateKernels({Place{TARGET(kX86)}, Place{TARGET(kHost)}});
#endif
if (kernels.size() > 0) {
picked_kernel = std::move(kernels.front());
......
......@@ -2,7 +2,7 @@
set -ex
# global variables with default value
BM_SDK_ROOT="$(pwd)/../BM_SDK" # BM SDK
BM_SDK_ROOT="$(pwd)/third-party/bmlibs/bm_sc3_libs" # BM SDK
TARGET_NAME="BM1682" # default target
BUILD_EXTRA=OFF # ON(with sequence ops)/OFF
WITH_TESTING=ON # ON/OFF
......@@ -39,6 +39,11 @@ function prepare_thirdparty {
else
git submodule update --init --recursive
fi
# clone bmlibs
if [ ! -d ${workspace}/third-party/bmlibs ]; then
git clone https://github.com/AnBaolei1984/bmlibs.git ${workspace}/third-party/bmlibs
fi
}
# for code gen, a source file is generated after a test, but is dependended by some targets in cmake.
......@@ -70,8 +75,8 @@ function build_bm {
${CMAKE_COMMON_OPTIONS} \
-DWITH_GPU=OFF \
-DWITH_MKLDNN=OFF \
-DLITE_WITH_X86=ON \
-DWITH_MKL=ON \
-DLITE_WITH_X86=OFF \
-DWITH_MKL=OFF \
-DLITE_BUILD_EXTRA=ON \
-DLITE_WITH_XPU=OFF \
-DLITE_WITH_BM=ON \
......@@ -92,10 +97,10 @@ function main {
TARGET_NAME="${i#*=}"
shift
;;
--bm_sdk_root=*)
BM_SDK_ROOT="${i#*=}"
shift
;;
#--bm_sdk_root=*)
# BM_SDK_ROOT="${i#*=}"
# shift
# ;;
bm)
build_bm
shift
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册