未验证 提交 c008ae69 编写于 作者: W Wilber 提交者: GitHub

update. (#28166)

上级 56aba4b7
...@@ -22,7 +22,7 @@ if(XPU_SDK_ROOT) ...@@ -22,7 +22,7 @@ if(XPU_SDK_ROOT)
set(LITE_WITH_XPU ON) set(LITE_WITH_XPU ON)
include_directories("${XPU_SDK_ROOT}/XTDK/include") include_directories("${XPU_SDK_ROOT}/XTDK/include")
include_directories("${XPU_SDK_ROOT}/XTCL/include") include_directories("${XPU_SDK_ROOT}/XTCL/include")
add_definitions(-DPADDLE_WITH_XPU) add_definitions(-DLITE_SUBGRAPH_WITH_XPU)
LINK_DIRECTORIES("${XPU_SDK_ROOT}/XTDK/shlib/") LINK_DIRECTORIES("${XPU_SDK_ROOT}/XTDK/shlib/")
LINK_DIRECTORIES("${XPU_SDK_ROOT}/XTDK/runtime/shlib/") LINK_DIRECTORIES("${XPU_SDK_ROOT}/XTDK/runtime/shlib/")
endif() endif()
......
...@@ -375,7 +375,7 @@ void AnalysisConfig::Update() { ...@@ -375,7 +375,7 @@ void AnalysisConfig::Update() {
} }
if (use_xpu_) { if (use_xpu_) {
#ifndef PADDLE_WITH_XPU #ifndef LITE_SUBGRAPH_WITH_XPU
PADDLE_THROW(platform::errors::Unavailable( PADDLE_THROW(platform::errors::Unavailable(
"You tried to use an XPU device, but Paddle was not compiled " "You tried to use an XPU device, but Paddle was not compiled "
"with XPU-runtime.")); "with XPU-runtime."));
......
...@@ -4,6 +4,6 @@ endif() ...@@ -4,6 +4,6 @@ endif()
cc_library(lite_op_teller SRCS op_teller.cc DEPS lite_full_static framework_proto device_context boost xxhash) cc_library(lite_op_teller SRCS op_teller.cc DEPS lite_full_static framework_proto device_context boost xxhash)
cc_library(lite_engine SRCS engine.cc DEPS lite_full_static framework_proto ${XPU_DEPS}) cc_library(lite_engine SRCS engine.cc DEPS lite_full_static framework_proto ${XPU_DEPS})
cc_library(lite_tensor_utils SRCS tensor_utils.cc DEPS memcpy lite_full_static framework_proto boost device_context) cc_library(lite_tensor_utils SRCS tensor_utils.cc DEPS memcpy lite_full_static framework_proto boost device_context ${XPU_DEPS})
cc_test(test_lite_engine SRCS test_engine.cc DEPS lite_engine protobuf framework_proto glog gtest analysis) cc_test(test_lite_engine SRCS test_engine.cc DEPS lite_engine protobuf framework_proto glog gtest analysis)
cc_test(test_lite_tensor_utils SRCS test_tensor_utils.cc DEPS lite_engine lite_tensor_utils) cc_test(test_lite_tensor_utils SRCS test_tensor_utils.cc DEPS lite_engine lite_tensor_utils)
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#define LITE_WITH_CUDA 1 #define LITE_WITH_CUDA 1
#endif #endif
#ifdef PADDLE_WITH_XPU #ifdef LITE_SUBGRAPH_WITH_XPU
#define LITE_WITH_XPU 1 #define LITE_WITH_XPU 1
#endif #endif
...@@ -59,7 +59,7 @@ paddle::lite_api::PaddlePredictor* EngineManager::Create( ...@@ -59,7 +59,7 @@ paddle::lite_api::PaddlePredictor* EngineManager::Create(
cfg.cpu_math_library_num_threads); cfg.cpu_math_library_num_threads);
#endif #endif
#ifdef PADDLE_WITH_XPU #ifdef LITE_SUBGRAPH_WITH_XPU
lite_cxx_config.set_xpu_workspace_l3_size_per_thread( lite_cxx_config.set_xpu_workspace_l3_size_per_thread(
cfg.xpu_l3_workspace_size); cfg.xpu_l3_workspace_size);
#endif #endif
......
...@@ -444,6 +444,8 @@ void BindAnalysisConfig(py::module *m) { ...@@ -444,6 +444,8 @@ void BindAnalysisConfig(py::module *m) {
.def("enable_use_gpu", &AnalysisConfig::EnableUseGpu, .def("enable_use_gpu", &AnalysisConfig::EnableUseGpu,
py::arg("memory_pool_init_size_mb"), py::arg("device_id") = 0) py::arg("memory_pool_init_size_mb"), py::arg("device_id") = 0)
.def("disable_gpu", &AnalysisConfig::DisableGpu) .def("disable_gpu", &AnalysisConfig::DisableGpu)
.def("enable_xpu", &AnalysisConfig::EnableXpu,
py::arg("l3_workspace_size"))
.def("use_gpu", &AnalysisConfig::use_gpu) .def("use_gpu", &AnalysisConfig::use_gpu)
.def("gpu_device_id", &AnalysisConfig::gpu_device_id) .def("gpu_device_id", &AnalysisConfig::gpu_device_id)
.def("memory_pool_init_size_mb", .def("memory_pool_init_size_mb",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册