未验证 提交 de951a94 编写于 作者: 石晓伟 提交者: GitHub

change the cmake and apis of lite engine, test=release/1.7 (#22935)

* change the cmake and apis of lite engine, test=develop

* change the cmake of lite engine, test=develop
上级 432c5a39
...@@ -24,6 +24,10 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR) ...@@ -24,6 +24,10 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
set(LITE_SOURCES_DIR ${THIRD_PARTY_PATH}/lite) set(LITE_SOURCES_DIR ${THIRD_PARTY_PATH}/lite)
set(LITE_INSTALL_DIR ${THIRD_PARTY_PATH}/install/lite) set(LITE_INSTALL_DIR ${THIRD_PARTY_PATH}/install/lite)
if(NOT LITE_GIT_TAG)
set(LITE_GIT_TAG 34c29406c27ee00cef033a98887403443eb2565f)
endif()
# No quotes, so cmake can resolve it as a command with arguments. # No quotes, so cmake can resolve it as a command with arguments.
set(LITE_BUILD_COMMAND $(MAKE) publish_inference -j) set(LITE_BUILD_COMMAND $(MAKE) publish_inference -j)
set(LITE_OPTIONAL_ARGS -DWITH_MKL=ON set(LITE_OPTIONAL_ARGS -DWITH_MKL=ON
...@@ -38,13 +42,14 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR) ...@@ -38,13 +42,14 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
-DLITE_BUILD_EXTRA=ON -DLITE_BUILD_EXTRA=ON
-DCUDNN_ROOT=${CUDNN_ROOT} -DCUDNN_ROOT=${CUDNN_ROOT}
-DLITE_WITH_STATIC_CUDA=OFF -DLITE_WITH_STATIC_CUDA=OFF
-DCUDA_ARCH_NAME=${CUDA_ARCH_NAME}
-DLITE_WITH_ARM=OFF) -DLITE_WITH_ARM=OFF)
ExternalProject_Add( ExternalProject_Add(
${LITE_PROJECT} ${LITE_PROJECT}
${EXTERNAL_PROJECT_LOG_ARGS} ${EXTERNAL_PROJECT_LOG_ARGS}
GIT_REPOSITORY "https://github.com/PaddlePaddle/Paddle-Lite.git" GIT_REPOSITORY "https://github.com/PaddlePaddle/Paddle-Lite.git"
GIT_TAG 0f875ef367bd2dbfa2e557eb2a2fc841bacdf6cf GIT_TAG ${LITE_GIT_TAG}
PREFIX ${LITE_SOURCES_DIR} PREFIX ${LITE_SOURCES_DIR}
UPDATE_COMMAND "" UPDATE_COMMAND ""
BUILD_COMMAND ${LITE_BUILD_COMMAND} BUILD_COMMAND ${LITE_BUILD_COMMAND}
......
...@@ -423,6 +423,11 @@ void BindAnalysisConfig(py::module *m) { ...@@ -423,6 +423,11 @@ void BindAnalysisConfig(py::module *m) {
py::arg("precision_mode") = AnalysisConfig::Precision::kFloat32, py::arg("precision_mode") = AnalysisConfig::Precision::kFloat32,
py::arg("use_static") = false, py::arg("use_calib_mode") = true) py::arg("use_static") = false, py::arg("use_calib_mode") = true)
.def("tensorrt_engine_enabled", &AnalysisConfig::tensorrt_engine_enabled) .def("tensorrt_engine_enabled", &AnalysisConfig::tensorrt_engine_enabled)
.def("enable_lite_engine", &AnalysisConfig::EnableLiteEngine,
py::arg("precision_mode") = AnalysisConfig::Precision::kFloat32,
py::arg("passes_filter") = std::vector<std::string>(),
py::arg("ops_filter") = std::vector<std::string>())
.def("lite_engine_enabled", &AnalysisConfig::lite_engine_enabled)
.def("switch_ir_debug", &AnalysisConfig::SwitchIrDebug, .def("switch_ir_debug", &AnalysisConfig::SwitchIrDebug,
py::arg("x") = true) py::arg("x") = true)
.def("enable_mkldnn", &AnalysisConfig::EnableMKLDNN) .def("enable_mkldnn", &AnalysisConfig::EnableMKLDNN)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册